Re: Flat file being "Scrambled"

2005-06-16 Thread Randal L. Schwartz
> "Mark" == Mark Wheeler <[EMAIL PROTECTED]> writes: Mark> Hi, Mark> Sorry, I don't understand. What's my breakage? Should I not use "flock"? You should use "flock", but properly. :) google for "site:stonehenge.com flock" for many examples of how to do it right. -- Randal L. Schwartz - Sto

Re: Flat file being "Scrambled"

2005-06-15 Thread Ken Williams
Hey Mark, I doubt any mortal brain could follow all the various permutations of clients hitting your files and trying to lock them while some other client is doing the same. But here's one way your data could get hosed: one client reads the file in between the time another client opened it f

Re: Flat file being "Scrambled"

2005-06-15 Thread Mark Wheeler
Hi, Sorry, I don't understand. What's my breakage? Should I not use "flock"? Thanks, Mark Mark> open (FILE, "> $pathtodatafile") || die ("Cannot open file"); Mark> flock (FILE, 2); 0wn3d! That's your breakage. Once in a blue mooon, you'll kill your entire data this way

Re: Flat file being "Scrambled"

2005-06-15 Thread Randal L. Schwartz
> "Mark" == Mark Wheeler <[EMAIL PROTECTED]> writes: Mark> open (FILE, "> $pathtodatafile") || die ("Cannot open file"); Mark> flock (FILE, 2); 0wn3d! That's your breakage. Once in a blue mooon, you'll kill your entire data this way. -- Randal L. Schwartz - Stonehenge Consulting Services,

Flat file being "Scrambled"

2005-06-15 Thread Mark Wheeler
Hi, Here's a quick question. This doesn't have anything to do with perl on my mac, but just a perl question. I have a a small script that simply increases a number by 1, when it is run, then writes the changes back to the file. I am using it to check how many people come to the site by way of