From: "Berger, Daniel" Date: 2002-05-14T02:30:23+09:00 Subject: RE: Inline editing (non-command line) > -----Original Message----- > From: Dave Thomas [mailto:Dave@PragmaticProgrammer.com] > > I don't believe there's a way to do this on most conventional file > systems without sing some temporary storage, either memory [or] a > file. I figured that memory of some kind would be required. > There are other issues with editing in place: if it blows up half way > through, you're left with a half-changed file. A 'rollback' option then. :) > So, the conventional way to do this is to copy the original to a new > file, then when you're done rename the new file to have the same name > as the original. Guy's mmap alternative looks interesting. I would have thought this was possible via seek and/or sysread & syswrite. I was also intrigued by Mark Jason-Dominus's Tie::File module which appears to cache the file (up to 2 mb or so by default) into memory. For those interested, you can find that module at http://search.cpan.org/search?dis=Tie-File. Regards, Dan