Thanks.  The C code worked fine (as did yours, John Carr).  It never
dawned on me that it would be as simple as that.

>> We have a user who is not fond of cached write()s and save-on-close in
>> AFS for a particular file of his.  He also does not have the source
>> code to the tool which is appending to the file, so modifying it to
>> flush is not possible at that level.
>>
> Flush? I assume you mean fsync. (Fflush empties the stdio buffer, this
> is not related to AFS).
>
> You can do the fsync with a different program on the host that is writing
> to the file. I have appended a minimal C program and a little perl script.
> Both can be used for this purpose. If you want a continuous update,
> put these programs in a shell loop together with an appropriate sleep.
>
> Note: The perl script needs syscall.ph installed. This file can be created
> with the h2ph utility that comes with perl. If you have problems creating
> this file, you can remove the require line in the perl script and replace
> "&SYS_fsync" by the number of the fsync syscall on your OS (see
> /usr/include/syscall.h).
>
> Regards, Hans


Reply via email to