On 8/31/06, Nath, Alok (STSD) <[EMAIL PROTECTED]> 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

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to