Re: FindFirstFileExW and MAX_PATH




"Remy Lebeau" <no.spam@xxxxxxxxxxx> wrote in message news:OHut%23wyTIHA.5208@xxxxxxxxxxxxxxxxxxxxxxx

"Egbert Nierop" <egbert_nierop@xxxxxxxxxxxxxx> wrote in message news:eRuk1nyTIHA.4696@xxxxxxxxxxxxxxxxxxxxxxx

I find it so interesting, that even a 64 bit OS, still uses that API, limited to 260 (249 in fact) characters for directories and files.

The complete path and filename together is limited to MAX_PATH characters by default, yes.

FindFirstFileExW tells us about the \\?\ prefix, to overcome that
limit, BUT the WIN32_FIND_DATA structure, contains just
260 characters for the cFilename section! :)

The cFilename member receives just the filename, not the complete path leading up to the filename. When '\\?\' is used, individual components of a path (aka each subfolder and file name) are each limited to 255 characters max. So receiving such a filename still fits within a buffer of MAX_PATH size regardless of whether '\\?\' is used or not.

I _know_ this, thanks anyway.

My question is, is there any workaround? Because of filenames are really 65K in theoretical length, or foldernames, it should be possible to enumerate through them.

The question why someone would like to do this, is not here of course, I want to reach that without limits :)

Let me ask it otherwise.
Is there a lower level routine available to enumerate through folders/files?



.



Relevant Pages

  • Re: FindFirstFileExW and MAX_PATH
    ... You are worried about cFilename being too ... characters, which will fit just fine inside of cFilename, which can hold 260 ... it should be possible to enumerate through them. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: determine default filename encoding
    ... > Suse tech support for the way filename characters are represented, ... Characters are characters - just bytes. ... Then if that coding differed from the LANG coding ... filenames that were written in encoding X as they were written, ...
    (comp.os.linux.setup)
  • Re: unix filename restriction
    ... underscore _ and the dot. ... You could use other characters, ... never met a *human* defined path of more than 80 chars (most of the ... If you want to be very sure, limit your filename to the DOS limit of 8 ...
    (comp.os.linux.development.apps)
  • Re: Error Message: "The File Name is Not Valid or Too Long...."
    ... I, then, proceed to name that file using only valid characters. ... the destination folder. ... That is not counting the drive letter and slashes or the filename itself. ... (Again - not counting the extension/dot.) ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Cannot delete files
    ... There HAS to be an 8.3 filename! ... I've not been brave enough to tell it Yes on THIS folder, ... characters don't look quite the same in this email font; ... but the SFN was "NOD~1.EE". ...
    (microsoft.public.windowsxp.perform_maintain)

Loading