The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi, You can use the Tie::File module, and move accross the file like a array, before writing you get the number of the last index of the array, then add data to the file, and then if it fails because of exception, you remove from the saved point towards. If it's binary data you should use seek for moving, etc... Could be a solution for what you want, if I understand well your problem. On the other hand, must it be stored in the filesystem, because, depending on your needs, on RDBMS with transactions... you don't get this "problem". Regards, |fire| at ircIn reply to Re: Writing to a file atomically without renaming
by fmerges
|
|