On 2025-02-18 Pali Rohár wrote: > Just one test case, can you check that your new readdir() function is > working correctly on these two paths? > > \\?\GLOBALROOT\Device\Harddisk0\Partition1\ > \\?\GLOBALROOT\Device\HardiskVolume1\ > > If you are not familiar with NT paths encoded in WinAPI paths, both > should refer to WinAPI C:\ (or whatever is the first partition of the > first disk in the system).
Yes, they work. With one partition, opendir fails with EIO, and GetLastError returns ERROR_UNRECOGNIZED_VOLUME (1005). That seems to mean that there's no recognized file system. I don't know if that error code should become something else than EIO. I guess it doesn't really matter. Trying //./PHYSICALDRIVE0 results in EIO and ERROR_GEN_FAILURE (31). In this case ENOTDIR would be better, but I have no idea if that error is possible in some very different situation too. May the exact errno doesn't matter too much with paths like this, and EIO is OK enough. These paths don't work with the old dirent. opendir fails with ENOENT. Now I noticed that "con" results in EIO and ERROR_NOT_FOUND (1168). I will add it to the list of errors that become ENOTDIR. The old dirent correctly uses ENOTDIR with "con". > I do not have any other comments for this. Looks good for me. Thanks! May I add you to the commit message with Reviewed-by? Would you like to be included in the credits in dirent.c? Your feedback made get_d_type() better and helped me spot the need for get_code_page(). > I was just surprised that FILENAME_MAX is in C99, I did not know about > it. I thought that it is MS invention, together with that value 260. > Now I checked and this macro is available since C89. So it is really > old. I didn't know either until I looked. It surprised me too. :-) -- Lasse Collin _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public