Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fsync

93 views
Skip to first unread message

Zoltan Kocsi

unread,
Nov 23, 2015, 7:43:17 AM11/23/15
to
Quick question:

Is there a Tcl command that is equivalent to the unix fsync() system
call? That is, a call that blocks until a given file is actually
written to disk? Note that I'm not talking about flush, which moves
data from user space to kernel space but a call that guarantees that
the data went to the disk and the disk said that it's on the platter.

Thanks,

Zoltan
--
Zoltán Kócsi
Bendor Research Pty. Ltd.

Rich

unread,
Nov 23, 2015, 7:55:04 AM11/23/15
to
Zoltan Kocsi <zol...@bendor.com.au> wrote:
> Quick question:

> Is there a Tcl command that is equivalent to the unix fsync() system
> call? That is, a call that blocks until a given file is actually
> written to disk? Note that I'm not talking about flush, which moves
> data from user space to kernel space but a call that guarantees that
> the data went to the disk and the disk said that it's on the platter.

Not in the base Tcl distribution.

The TclX extension, however, does have a 'sync' command that makes the
appropriate kernel call:

http://wiki.tcl.tk/2053

Whether your kernel, filesystem, and disk hardware tell the truth is
beyond both Tcl's and TclX's control.

Zoltan Kocsi

unread,
Nov 23, 2015, 8:42:42 PM11/23/15
to
On Mon, 23 Nov 2015 12:52:38 -0000 (UTC)
Rich <ri...@example.invalid> wrote:

> The TclX extension, however, does have a 'sync' command that makes the
> appropriate kernel call:
>
> http://wiki.tcl.tk/2053

That's what I need, thanks a lot!

> Whether your kernel, filesystem, and disk hardware tell the truth is
> beyond both Tcl's and TclX's control.

Yes, I know. But I've seen someone testing disks and most known-brand
drives do actually tell the truth. On the other hand, USB sticks seem
to be compulsory liars. It was a few years back, so things might have
changed, though.

Thanks again!
0 new messages