From: Rick DeNatale Date: 2007-06-14T03:16:01+09:00 Subject: Re: why writing the file is partial On 6/13/07, Li Chen wrote: > > > But this will only work in the case where the replacement is the same > > length at the original, if you you're either going to leave stuff > > behind, or will overwrite the next line. In either case you're more > > likely to end up with gibberish than something you like. > > What am I supposed to do if the replacement is not same size? Write to another file, then rename when you are done. This is standard posix practice. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/