You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the file_lock ctor throws if the file does not exist. it would be nice to be able to have a signature that creates the file automatically if it doesn't exist. currently the ctor uses open_existing_file, maybe it could be extended by a boolean argument to use create_or_open_file if the users wants that semantics.
thoughts?
The text was updated successfully, but these errors were encountered:
only a single system call is required (open or create_file take care of the rest), so it should be slightly faster
it reduces the risk of race conditions when multiple processes may create the file or delete the file. open / create_file is be atomic on the filesystem level, but once people start using library wrappers like filesystem::exists(), creating a file with ofstream, change permissions etc a layman developer will easily run into unintended race conditions
the
file_lock
ctor throws if the file does not exist. it would be nice to be able to have a signature that creates the file automatically if it doesn't exist. currently the ctor usesopen_existing_file
, maybe it could be extended by a boolean argument to usecreate_or_open_file
if the users wants that semantics.thoughts?
The text was updated successfully, but these errors were encountered: