If two separate processes open the same file for append, each process may write freely to the file without fear of destroying output being written by the other. The output from the two processes will be intermixed in the file in the order in which it is written.
This is kinda discussed in some other thread, but basically if you are just appending a single line (e.g. some sort of log file) there is probably no strong compelling reason to lock the file. Locking does add a little overhead. If you are writing (i.e. changing any pre-existing data) definitely lock. If appending, almost always lock. :) From your example, I would definitely lock, but thought I would add this note anyway.
In reply to RE: Re: Re: flock
by turnstep
in thread Re: flock
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |