J
Jazeker
Hello,
This question may be a bit out of scope. Just let me know.
I have some Perl/CGI scripts that write to/read from a text file. 'till
now, I always assumed that when you open a file for writing, the OS will
not allow another instance of the script to do the same (via refusing or
making it wait, ...) and that the Perl programmer should not be
concerned with that. I have seen that Perl offers locking mechanisms,
but I usually see them in the context of random I/O file handling (and
IIRC in binary mode).
Am I wrong and do I have to include file locking in my script when using
the usual simple text file handling like :
open (TEST, "> test.txt") || die "Error opening test.txt";
print TEST "hello";
close TEST || die "Error opening test.txt";
Sorry for the somewhat off-topicness of this message... just a link to
a better newsgroup or a good read will suffice then
thx
This question may be a bit out of scope. Just let me know.
I have some Perl/CGI scripts that write to/read from a text file. 'till
now, I always assumed that when you open a file for writing, the OS will
not allow another instance of the script to do the same (via refusing or
making it wait, ...) and that the Perl programmer should not be
concerned with that. I have seen that Perl offers locking mechanisms,
but I usually see them in the context of random I/O file handling (and
IIRC in binary mode).
Am I wrong and do I have to include file locking in my script when using
the usual simple text file handling like :
open (TEST, "> test.txt") || die "Error opening test.txt";
print TEST "hello";
close TEST || die "Error opening test.txt";
Sorry for the somewhat off-topicness of this message... just a link to
a better newsgroup or a good read will suffice then
thx