Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAX_PATH limitation in Boost.Filesystem

I want to use Boost.Filesystem library to manipulate paths, files and directories. My question is are paths longer than MAX_PATH supported?

I know that in Win32API we have workaround "\\?\" but it's not supported by basic functions like PathAppend and PathCombine.

So I'm looking for any useful info about MAX_PATH and Boost.FS.

Thanks

UPD: I care for all operation like path append, path combine, etc (I have those functions in Win32API, but they doesn't work with paths longer than MAX_PATH) For example CreateFileW and DeleteFileW both support paths longer than MAX_PATH. May Boost.FS be a replacement for Win32API utility functions such as those found in shlwapi and shell32 which often do not support long paths

like image 938
SlavaNov Avatar asked Jan 05 '11 16:01

SlavaNov


1 Answers

The truth is that Windows supports paths of any length, and any path can be converted to string on windows. Adding \\?\ is required in such case, but this is the part of "make a string out of a given path" operation.

AFAIK, Boost::FileSystem does this wrong on windows.

I do not know if a fix is planned. See this about how it should be done.

like image 61
Pavel Radzivilovsky Avatar answered Sep 23 '22 03:09

Pavel Radzivilovsky