Does the GetFullPathName function work with relative paths longer than MAX_PATH?

The documentation for GetFullPathName() says that to use paths longer than MAX_PATH (260 characters) I need to add a file namespace prefix: \\?\ . However, the general documentation on file names says that this prefix cannot be used with relative paths, and therefore the relative path length is always limited to 260 characters. Does this mean that there is no way to use GetFullPathName() with a relative path longer than MAX_PATH ? (If so, then I understand that the function really does not support long paths, if only the past path is already complete.)

+5
source share
1 answer

I agree, this is pointless. The native api has no concept of relative paths; it is a pure winapi level function. It can be interpreted as a way to return a function to return the path name. But it is not, I checked. Looks like a doc copy / paste error.

Keep an eye on the ball when you need GetFullPathName (), after which you lose anyway. Because GetCurrentDirectory () is already subject to the MAX_PATH limit. Thus, long path support is already outside the window.

The general advice is to never rely on relative paths, even if you don't need long path support. Too many accidents. The only reasonable rejection is if you want to write a simple console application that is expected to be displayed on the command line. And then you don't care, because the command line interpreter is burdened with MAX_PATH.

+8
source

Source: https://habr.com/ru/post/1211874/


All Articles