Benjamin Goldberg <[EMAIL PROTECTED]> writes:
> "J�Rgen B�Mmels" wrote:
> [snip]
> > void
> > PIO_unix_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
> > {
> > -# if 0
> > fsync(io->fd);
> > -# endif
> > }
>
> AFAIK, for disk files, fsync has (should have) no visible effect from
> the point of view of any user program -- all it does is tell the OS to
> start writing the OS-level cache for that handle to disk, and it blocks
> until all is copied.
I think this is correct.
> So... it is a slow system call, with no visible
> effect -- why do we do it?
Deepends on the semantics we want to have for flush. I thought of
flush to disk, but just flush to OS is also a valid asumption. This is
what fflush also does.
> It's possible that fsync()ing will sometimes be desired, but, IMHO, I
> don't think that it should be done by flush -- I'd rather it be done by
> an explicit call to sychronized the handle with the disk.
Maybe another API-Function "Sync" should be added. Not sure.
bye
boe