command pipe concatenated messages
Jim Mozley
jim.mozley at exponential-e.com
Mon Dec 29 12:06:58 CET 2003
John P. Rouillard wrote:
> I would use ">> $pipe" to append data for two reasons:
>
> 1 - > clobbers data already existing in files, not sure about in pipes
> 2 - atomic writes occur only if file is opened for append IIRC.
>
>
>>flock(PIPE, LOCK_EX);
>
>
> This should guarantee only one process is accessing the file, but I
> think you have already written to the file by using > in your open, so
> there may be a race condition.
IIRC it is not possible to open a filehandle to a pipe using ">> $pipe",
one must use "> $pipe". I get "Cannot open pipe Illegal seek at ..."
when trying.
Regards,
Jim
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
More information about the Developers
mailing list