Question : WIN32-Perl file Locking

I'd like to know if I try to access (writing & reading) to one file by 2 processes if I can have problems of "merging printing".
I've tryed to lock the file using the lock procedure like in Unix-Perl but Perl intrpreter says "NOt implemented".
By now I had not problems and so I asked my self if the subsystem lock them by default.

Thanks

zuppy

Answer : WIN32-Perl file Locking

YES!

It is very strange that you have a system that does not implement flock() but if it does not you will need to do something yourself if you are concerned about this.

I have one system where this is a rpoblem myself.  I use a file:
dmbopen(%,"locks",0644);

I use the file name that I am locking as the key and the process ID and time as the value.  When I am done with the file I remove it.  The reason that I add the time is so that a process that does not complete can be cleaned by noticing that the time is old and the process has probably failed.

Howevetr, I am amazed that you have a system where flock() does not work, see:
http://www.cs.cmu.edu/People/rgs/pl-exp-io.html#flock

Now, you may have a problem if the other process is not perl, since then you have no chance of using my dbmopen file and flock may be implemented in perl, not using the os version.  However, even if the OS version works you have no guarantee that the non perl process uese it.
Random Solutions  
 
programming4us programming4us