Directory Enumerator for folder having files with path length beyond 260 bytes
-
How to implement the dirctory enumerator for the directory having files with the path length more than 260 bytes?. WIN32_FIND_DATA structure used in the FindNextFile() limits the cFileName to MAX_PATH which is defined as 260. If we are trying to implement the directory enumerator for the Japanese language, then it is quite possible to have paths beyond 260 bytes. During that time, FindNextFile will fail to get the elements. Please let me know for any work around for the same. Thanks in advance -Sandeep
-
How to implement the dirctory enumerator for the directory having files with the path length more than 260 bytes?. WIN32_FIND_DATA structure used in the FindNextFile() limits the cFileName to MAX_PATH which is defined as 260. If we are trying to implement the directory enumerator for the Japanese language, then it is quite possible to have paths beyond 260 bytes. During that time, FindNextFile will fail to get the elements. Please let me know for any work around for the same. Thanks in advance -Sandeep
Instead of using MAX_PATH use a Unicode string.
-
How to implement the dirctory enumerator for the directory having files with the path length more than 260 bytes?. WIN32_FIND_DATA structure used in the FindNextFile() limits the cFileName to MAX_PATH which is defined as 260. If we are trying to implement the directory enumerator for the Japanese language, then it is quite possible to have paths beyond 260 bytes. During that time, FindNextFile will fail to get the elements. Please let me know for any work around for the same. Thanks in advance -Sandeep
A Unicode app can create a file with a full path longer than
MAX_PATH
characters, butcFileName
is not the full path, it's just the name+extension of whatever was found. This cannot exceedMAX_PATH
TCHAR
s.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
A Unicode app can create a file with a full path longer than
MAX_PATH
characters, butcFileName
is not the full path, it's just the name+extension of whatever was found. This cannot exceedMAX_PATH
TCHAR
s.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Windows allows to create the file names beyond 260 bytes ( allows upto 255 characters). If we take the japanese OS, file name and extenstion with 150 characters can take more than 300 bytes. This is something cFileName cannot handle I think. Any suggetions on this front?. Thanks in advance Sandeep
-
Windows allows to create the file names beyond 260 bytes ( allows upto 255 characters). If we take the japanese OS, file name and extenstion with 150 characters can take more than 300 bytes. This is something cFileName cannot handle I think. Any suggetions on this front?. Thanks in advance Sandeep
Sandeep. Vaidya wrote:
Windows allows to create the file names beyond 260 bytes ( allows upto 255 characters).
How are you doing this? I'm unable to do it in Explorer, and the docs on file names[^] say each component of the full path can't exceed
MAX_PATH
characters (note: unicode characters, not bytes).--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
Windows allows to create the file names beyond 260 bytes ( allows upto 255 characters). If we take the japanese OS, file name and extenstion with 150 characters can take more than 300 bytes. This is something cFileName cannot handle I think. Any suggetions on this front?. Thanks in advance Sandeep
I Have a folder folder1 created in the desktop in Japanese OS. I have folder2 created inside folder1. Length of the full path for folder2 is 244 characters ( not bytes). It has some files also and the complete path is within the 260 characters ( not bytes). If I start the enumeration on the top folder i.e folder1, I get the next file sproperly for all other files. when it comes to folder2, FindNextFile() return zero. I tried the GetLastError() and found that it is not ERROR_NO_MORE_FILES.