If you are only reading in the file *and no one else is writing in it at the same time*, you do not have to lock it.
In fact, you would only need to lock anything for read when 1) your read is non-atomic and 2) the data you're reading might be changed by a writer during your read. I'd say that in your case neither of these conditions is true (although you can't be sure of 1) ).
CU
Robartes-
In reply to Re: Flock a file when just reading it?
by robartes
in thread Flock a file when just reading it?
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |