Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top