>>>>> "dn" == david nicol <whatever@davidnicol.com> writes: >> And I'd expect to find it under File::. dn> but it is now under Tie:: dn> Tie::Slurp has just been uploaded to CPAN. dn> Tie::Slurp uses the __advisory__ nature of Flock locking to prevent dn> slurping a freshly truncated file put there by another process, by dn> opening the file, locking it exclusively, then opening it again in dn> truncate mode, and writing to the second handle, closing the second dn> handle, unlocking, then closing the first handle. this would be trivial to add to my module as it has the options interface. but i would use a mkdir lock wrapper instead. also my write_file does an overwrite and does not truncate (to its real size) until after the file is written. if the file is short enough, then the write will likely be atomic anyway. dn> Is that going to be safe and portable? i won't get into a lock and portability war :) uri -- Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com --Perl Consulting, Stem Development, Systems Architecture, Design and Coding- Search or Offer Perl Jobs ---------------------------- http://jobs.perl.orgThread Previous | Thread Next