Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileIO bug for Test when opening new file for writing #1297

Closed
janigbg opened this issue Feb 9, 2024 · 1 comment
Closed

FileIO bug for Test when opening new file for writing #1297

janigbg opened this issue Feb 9, 2024 · 1 comment

Comments

@janigbg
Copy link

janigbg commented Feb 9, 2024

When opening a new file for writing using the FileIO Test implementation I get a FileNotFoundException.
According to Microsoft docs the File.OpenWrite() method used should allow that:
https://learn.microsoft.com/en-us/dotnet/api/System.IO.File.OpenWrite?view=net-7.0#remarks

The FileMode is currently set to Open instead of OpenOrCreate in the test implementation.

Repro (this should not fail):

var effect =
    File<Runtime>.openWrite("c:\\file")
    | Consumer.mapM<Runtime, Stream, Unit>(_ => unitEff);

var result = await effect.RunEffect().Run(Runtime.New());
result.ThrowIfFail();
louthy added a commit that referenced this issue Oct 21, 2024
Dropped MemoryFS and instead using tmp directory as a mock file-system

#1297

#1298
@louthy
Copy link
Owner

louthy commented Oct 21, 2024

Fix is done. Coming in next release: v5.0.0-beta-29

@louthy louthy closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants