We are running a data retrieval program which allows users to append to a file. I programmed the cgi script to to use FLOCK (see at bottom) but our web host tells me that flock is running over network file server sharing files among various users so FLOCK sometimes fails.
We are in a critical situation right now with data being lost from our clients because of this and I am desperate for an alternative file locking method.
Any advice?
Here is a snip of our cgi script utilizing FLOCK:
open(FILE, ">>/var/tilt/zzzzz/private/web.txt"
> flock(FILE,2);
> seek(FILE,0,2);
> print FILE "SUB CODE:";print FILE "$contents{'SUBCODE'}";
> <etc etc etc>
> print FILE "Info submitted ";
> print FILE "$date\n";
> print FILE " --- ";
> close (FILE);
> exit;
We are in a critical situation right now with data being lost from our clients because of this and I am desperate for an alternative file locking method.
Any advice?
Here is a snip of our cgi script utilizing FLOCK:
open(FILE, ">>/var/tilt/zzzzz/private/web.txt"
> flock(FILE,2);
> seek(FILE,0,2);
> print FILE "SUB CODE:";print FILE "$contents{'SUBCODE'}";
> <etc etc etc>
> print FILE "Info submitted ";
> print FILE "$date\n";
> print FILE " --- ";
> close (FILE);
> exit;