Re: Corrupted Data

2003-10-30 Thread Jimstone77
In a message dated 10/30/03 12:04:07 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > Yes there is. (Apart from the typo on the open(NEW,...) line.) > > The problem is that things could happened between you close the old > file and rename the new one. And even more likely there can be a

Re: Corrupted Data

2003-10-30 Thread Tore Aursand
On Thu, 30 Oct 2003 09:45:58 -0500, Jimstone77 wrote: > open(OLD,">$old") or die "Can't Open File: $!"; > flock OLD, 2; > open(NEW,$new) or die "Can't Open File: $!"; > flock NEW, 2; >while () { > if ($_ =~ /NO_EMAIL/) { >$count++; >

Re: Corrupted Data

2003-10-30 Thread Jenda Krynicky
From: [EMAIL PROTECTED] > $old = "oldfile.txt"; > $new = "newfile.txt"; > > open(OLD,"$old") or die "Can't Open File: $!"; > flock OLD, 2; > open(NEW,>$new) or die "Can't Open File: $!"; > flock NEW, 2; >while () { > if ($_ =~ /NO_EMAIL/) {

Re: Corrupted Data

2003-10-30 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: > $old = "oldfile.txt"; > $new = "newfile.txt"; > > open(OLD,"$old") or die "Can't Open File: $!"; >flock OLD, 2; > open(NEW,>$new) or die "Can't Open File: $!"; > flock NEW, 2; > while () { >

Re: Corrupted Data

2003-10-30 Thread Kevin Pfeiffer
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > I'm having problems with corrupted data about every month or so. The > problem > seems to be that the New file sometimes writes only about half the old > file. I was under the impression that flock would preven

Re: Corrupted Data

2003-10-30 Thread Jimstone77
In a message dated 10/30/03 10:35:08 AM Eastern Standard Time, [EMAIL PROTECTED] writes: > ] > > Why don't you post the actual code since this obviously isn't it... $old = "oldfile.txt"; $new = "newfile.txt"; open(OLD,"$old") or die "Can't Open File: $!"; flock OLD, 2;

Re: Corrupted Data

2003-10-30 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: > I'm having problems with corrupted data about every month or so. The problem >seems to be that the New file sometimes writes only about half the old file. >I was under the impression that flock would prevent

Corrupted Data

2003-10-30 Thread Jimstone77
I'm having problems with corrupted data about every month or so. The problem seems to be that the New file sometimes writes only about half the old file. I was under the impression that flock would prevent the data from being corrupted. Can anyone tel me what I am doing wrong, and w