flush file system on copy
See original GitHub issuei have to ensure that the files copied using fse.copy()
are actually written to the physical drive.
i’m proposing a flag for it in the function’s options object.
this could be achieved by using fs.fsync()
or possibly even by simply listening for the 'finish'
event instead of the 'close'
event.
second way sure is really easy to implement. however i’m unsure what “has been flushed to the underlying system” actually means.
if it flushes to windows’ write cache then it’s unsufficient.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:14 (2 by maintainers)
Top Results From Across the Web
How can I perform a CopyFile, but also flush the file buffers ...
A customer wanted to copy a file, and the CopyFile function seemed to do the trick. However, they also wanted to perform a...
Read more >What does it mean to 'flush to disk'? - Stack Overflow
All data is immediately written to a persistent log on the filesystem without necessarily flushing to disk. In effect this just means that...
Read more >File flush() method in Python - GeeksforGeeks
The flush() method in Python file handling clears the internal buffer of the file. In Python, files are automatically flushed while closing ...
Read more >Manually flushing write cache on Windows - Super User
Use it whenever you want to know that modified file data is safely stored on your hard drives. Unfortunately, Sync requires administrative ...
Read more >How to flush writes to disk aggressively? - Unix Stack Exchange
You can sync just a file with fsync or (sans metadata changes) with fdatasync, just a file system with syncfs, or everything with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Inve1951 thanks for your help here. We all appreciate your work. However, I am on the same page as @RyanZim. I am personally not inclined to add this feature. Primarily because I think it somehow breaks the overall consistency of
fs-extra
functions, as @RyanZim pointed out:@jprichardson I’m not sure if this is within scope for fs-extra. If we add this here, where else will we need to add it? Personally, I think this warrants a separate module if we’re going to worry about this kind of low-level stuff.
CC: @manidlou