question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

flush file system on copy

See original GitHub issue

i 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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
manidloucommented, May 27, 2017

@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:

If we add this here, where else will we need to add it?

1reaction
RyanZimcommented, May 26, 2017

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found