Description
Your structs dirent
, dirent64
are wrong at x86_64-unknown-linux-gnu. Their field d_name
contains 256 bytes. But names can be bigger than 256 bytes in NTFS (in Linux). I was able to create NTFS partition in my Linux and then create file with name "ыыыы..." (250 times "ы", this is Cyrillic letter). Such name contains more than 256 bytes (if you have difficulties with reproducing, I can provide more details).
So, fix structs. I am not sure how exactly fix should be implemented. Maybe [c_char; 512]
, but in this case we need to double check what is true upper limit. Maybe we can simply put [c_char; 1]
or [c_char; 0]
. Of course, it would be perfect to make dirent
unsized, but with machine word sized reference. Unfortunately, as well as I know, such unsized structs are not possible in stable Rust