For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > January 2005 > Re: When does the Solaris kernel flush data to a file descriptor









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: When does the Solaris kernel flush data to a file descriptor
Dragan Cvetkovic

2005-01-14, 3:59 pm

mills@cc.umanitoba.ca (Gary Mills) writes:

> In <41e78a47$0$6216$e4fe514c@news.xs4all.nl> Casper H.S. Dik <Casper.Dik@Sun.COM> writes:
>
>
>
>
>
> I'm wondering if the original question was really about how soon
> another process could read back the data from the file. In that
> case, it should be available immediately after the close() returns,
> even though it only resides in memory at the time. I'm assuming
> that UFS guarantees this behavior.
>


To quote write(2) man page on Solaris

After a write() to a regular file has successfully returned:

o Any successful read(2) from each byte position in the
file that was modified by that write will return the
data specified by the write() for that position until
such byte positions are again modified.

o Any subsequent successful write() to the same byte
position in the file will overwrite that file data.

The OP's questions could also be interpreted in the sense of "if I switch
off my hard disk (or my machine) at that point, what would happen to the
data?".

Dragan

--
Dragan Cvetkovic,

To be or not to be is true. G. Boole No it isn't. L. E. J. Brouwer

!!! Sender/From address is bogus. Use reply-to one !!!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com