From: Gary Wright Date: 2010-01-17T04:18:04+09:00 Subject: Re: How can I modify the xml file directly? On Jan 16, 2010, at 12:50 PM, Seebs wrote: > On 2010-01-16, Milo Luo wrote: >> I meant without string or tmp file, write to original file. > > In general, on most systems, the only modifications you can make without > a temporary file or something comparable are those which do not change the > number of characters in a file. You can't insert or delete characters in > the middle of a file. I often wondered if there is any OS floating around out there that goes beyond the traditional file semantics (replace, append, truncate, extend). For example: -- prepend -- delete (from beginning or middle) -- insert I would think that many of those operations would be painfully inefficient unless perhaps they were done on block-sized chunks to avoid having to keep track of partially used blocks. Gary Wright