-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
please add an option to File.writeAsBytes
to avoid overwriting.
#59587
Comments
Summary: User requests |
What behavior do you expect in case the file already exists? Throw exception? |
@julemand101 yes |
Have you looked at https://api.dart.dev/dart-io/File/create.html which allows you to specify |
From my understanding create guarantee you to create the file, but from my understanding File is not a file descriptor so now that the file is created overwrite can still happens |
@stephane-archer AFAIK there is no way to prevent that in POSIX though - if the other program does not take precautions (e.g. does not use |
please add an option to
File.writeAsBytes
to avoid overwriting.maybe something like
await outputFile.writeAsBytes(jpegData, exclusive: true);
The text was updated successfully, but these errors were encountered: