ned14 / llfio

P1031 low level file i/o and filesystem library for the C++ standard
https://ned14.github.io/llfio/
Other
846 stars 45 forks source link

Windows does not like default `llfio::open` arguments #135

Open ethindp opened 3 months ago

ethindp commented 3 months ago

The default flags argument on windows (flag::none) is something windows doesn't like for some reason. On my windows 10 machine, the open succeeds but llfio::read gives me a "not supported" error. Changing flags to flag::multiplexable (at minimum) does work though. A bit uncertain as to why this is being caused, so am curious if it's a bug in llfio or if it's something weird happening when llfio opens the file?

ned14 commented 3 months ago

I would be very surprised if the defaults don't "just work" given how much this codebase is used on Windows.

I also traced through the code and I can see no obvious reason why opening a file would give an error.

Can you perhaps give me an example piece of code which fails for you?

ethindp commented 3 months ago

The opening of the file doesn't fail. The error is delayed until the first read. As soon as llfio::read is called when flags is set to flag::none, windows (at least my version) returns the error Not supported: Not supported: "". I think the most relevant example woudl be the read_entire_file1.cpp example. When I used that example to learn how to implement a file that read into a string, that's when I got that (very odd) error (when I did the actual read). But when I set flag::multiplexable, windows is just fine.

BurningEnlightenment commented 1 month ago

Can you add procmon traces for the failing and succeeding cases? I could take a look this week.