in reply to Re: A flock()alypse now
in thread A flock()alypse now

Yeah, that would work too :)

It would be "simplest" if you are familiar with dealing with read/write filehandles. Unfortunately I'm not that familiar with those techniques right now. So it's not "simplest" for me until I learn a bit more.

Thanks for the alternate solution, and a pointer towards more things to learn.

Alan

Replies are listed 'Best First'.
Re: Re: Re: A flock()alypse now
by tomhukins (Curate) on Jul 02, 2002 at 20:20 UTC

    This approach causes data loss if:

    • the process is terminated for any reason (user intervention, exceeding resource limits, system crash)
    • the disk fills up during execution

    If you don't want to risk losing data, use the sentinel locking approach already mentioned by others in this thread.

    However, if the weaknesses of using only a read/write filehandle aren't a problem for you, you might want to look into FileHandle::Rollback.