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

Unhandled Exception: FileSystemException: File closed #94

Closed
mixable opened this issue Nov 21, 2022 · 1 comment
Closed

Unhandled Exception: FileSystemException: File closed #94

mixable opened this issue Nov 21, 2022 · 1 comment
Assignees

Comments

@mixable
Copy link

mixable commented Nov 21, 2022

I want to use LocalStorage with different files (keys). Each of the files is opened with LocaleStorage('my_file.ext'). I always open only one file, there are not multiple files open at the same time.

When working on Windows, I have to call the dispose() method to close a file before opening another. This is necessary to release the file handle. This works as expected, calling dispose() before opening another file will release the file handle. If dispose() is not called, the file cannot be edited or deleted until the app is closed.

When opening the same file again, LocalStorage uses the file instance stored in _cache map. As the file handler has been disposed, the following exception is thrown:

Unhandled Exception: FileSystemException: File closed, path = '...'

To make this work, it is necessary to remove the instance from _cache, when calling dispose(). Otherwise it's not possible to read or write the same file later. This is also a problem when you handle files with the same name but in different paths.

@lesnitsky lesnitsky self-assigned this Nov 24, 2022
@srolemberg
Copy link
Contributor

Im over the same problem here. Im switching screens and saving some data with 3 files names.

They works normal over the frist run, but fails after a secong load of any of them.

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

3 participants