-1

I'm using FindFirstFile and FindNextFile (kernel32) to get folders and files (c# Pinvoke). System.IO is too slow and does not support path over 250 chars.

Is it possible to use the handle - in any way - returned by FindNextFile to get the byte length of a file?

Current try returns INVALID_HANDLE. I think the reason is the directory callback instead of the createfile callback.

I want to avoid to call CreateFile again to get the file handle "twice"; it's very slow.

Thanks.

sAnS
  • 1,169
  • 1
  • 7
  • 10
DerAbt
  • 337
  • 1
  • 5
  • 14

1 Answers1

4

FindNextFile does not return a handle. Not sure why you think that would be the case.

WIN32_FIND_DATA contains the file size. This structure is being filled by FindNextFile.

usr
  • 168,620
  • 35
  • 240
  • 369