Skip to content

Dart:io feature request: Fsync and Fdatasync #8794

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

Closed
DartBot opened this issue Feb 26, 2013 · 10 comments
Closed

Dart:io feature request: Fsync and Fdatasync #8794

DartBot opened this issue Feb 26, 2013 · 10 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io
Milestone

Comments

@DartBot
Copy link

DartBot commented Feb 26, 2013

This issue was originally filed by [email protected]


Hi,

I would like to have knowledge and control about whether file data and file metadata is sent to disk or not.

Like fsync and fdatasync on Linux.

This seems quite important to me for server systems.
If an operating system or filesystem does not support that control, than Dart should just ignore the fsync and fdatasync option.

Java NIO offers such control in the form of SYNC and DSYNC.
http://docs.oracle.com/javase/tutorial/essential/io/file.html
http://docs.oracle.com/javase/7/docs/api/java/nio/file/StandardOpenOption.html

And .net offers a similar control as well:
http://msdn.microsoft.com/en-us/library/2bw4h516%28v=VS.90%29.aspx

Best regards

@whesse
Copy link
Contributor

whesse commented Feb 26, 2013

Added Area-IO, Triaged labels.

@sgjesse
Copy link
Contributor

sgjesse commented Jun 20, 2013

Windows have the system call FlushFileBuffers which is equivalent to fsync. There does not seem to be something that distinguishes fsync and fsyncdata on Windows.

It would be possible to add methods sync() and syncSync() to RandomAccessFile.

File.openWrite returns an IOSink so in that case IOSink should have a flush method returning a future.

Finally the methods writeAsBytes, writeAsBytesSync, writeAsString, writeAsStringSync this would require an additional flag unless we always flush (they all use File.openWrite internally).

@sgjesse
Copy link
Contributor

sgjesse commented Jul 23, 2013

Set owner to @sgjesse.
Added this to the M6 milestone.

@sgjesse
Copy link
Contributor

sgjesse commented Aug 1, 2013

For RandomAccessFile fsync was already available through the methods flush() and flushSync().

Proposed change for IOSink and related methods in https://codereview.chromium.org/20745006/.

There will not be support for fdatasync.


Added Started label.

@larsbak
Copy link

larsbak commented Aug 28, 2013

Removed this from the M6 milestone.
Added this to the M7 milestone.

@sgjesse
Copy link
Contributor

sgjesse commented Sep 25, 2013

Removed this from the M7 milestone.
Added this to the M8 milestone.

@DartBot
Copy link
Author

DartBot commented Oct 31, 2013

This comment was originally written by [email protected]


Thanks for your continuing attention on this subject :)

@sgjesse
Copy link
Contributor

sgjesse commented Nov 5, 2013

IOSink.flush added in https://code.google.com/p/dart/source/detail?r=29550

Added optional flush argument to some File methods in https://code.google.com/p/dart/source/detail?r=29880


Added Fixed label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels May 14, 2014
@DartBot DartBot added this to the M8 milestone May 14, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io
Projects
None yet
Development

No branches or pull requests

5 participants