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
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++;
>
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/) {
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 () {
>
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
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;
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
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