Re: File locking issue
- From: tom@xxxxxxxxxxxxxx (Tom Phoenix)
- Date: Thu, 31 Aug 2006 09:19:04 -0700
On 8/31/06, Nath, Alok (STSD) <alok.nath@xxxxxx> wrote:
What I am seeing is when I enable the file locking commands
the file is completely wiped out.Just zero bytes.
#use lock to write into the file
sysopen( FH, $registerFile, O_RDWR )
or die "can't open $registerFile: $!";
flock( FH, LOCK_EX)
or die "can't lock filename: $!";
truncate(FH, 0) or die "can't truncate filename: $!";
I think I know where the "zero bytes" are coming from. :-)
$twig->parsefile( $registerFile );
What are you hoping to parse from the file that you've just truncated
to zero bytes?
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
.
- References:
- File locking issue
- From: Alok Nath
- File locking issue
- Prev by Date: DBI::st=HASH(0x88f6520)
- Next by Date: Re: DBI::st=HASH(0x88f6520)
- Previous by thread: Re: File locking issue
- Next by thread: DBI::st=HASH(0x88f6520)
- Index(es):
Relevant Pages
|