llfio icon indicating copy to clipboard operation
llfio copied to clipboard

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

Open ethindp opened this issue 1 year ago • 3 comments

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?

ethindp avatar Jun 22 '24 08:06 ethindp

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?

ned14 avatar Jun 25 '24 14:06 ned14

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.

ethindp avatar Jun 26 '24 13:06 ethindp

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

BurningEnlightenment avatar Aug 26 '24 08:08 BurningEnlightenment