Re: imapd and synchronous writes

sct@dcs.ed.ac.uk
Wed, 20 Mar 96 01:57 GMT


Hi,

On Tue, 19 Mar 1996 08:40:40 +0100, Ulrich Windl
<Ulrich.Windl@rz.uni-regensburg.de> said:

> On 18 Mar 96 at 18:11, sct@dcs.ed.ac.uk wrote:
>> Not true. {int fd = open(".", O_RDONLY, 0); int rc = fsync(fd); close(fd)}
> ^^^^^^ ^^^^^^^^
> Does it work? Syncing a file that's opened read-only?

Yes. fsync() flushes all data associated with an inode, regardless of
whether or not it was written under any particular file descriptor.
The write mode on the fd is irrelevant, and you cannot open a
directory for write anyway.

Cheers,
Stephen.

--
Stephen Tweedie <sct@dcs.ed.ac.uk>
Department of Computer Science, Edinburgh University, Scotland.