On Mon, Aug 14, 2006 at 09:42:59AM +0200, Peter Eisentraut wrote: > > Yes, there is: sed -i is not an atomic file replacement, so there is a > > window during which a failure (kernel panic, power outage, filesystem > > error...) would cause the user's smb.conf to be lost.
> I can't follow that. I traced the sed source code, and it seems that sed -i > always writes to a temp file and then renames the temp file to the original > file name. It is also careful to create the temporary file in the same > directory as the file to be edited, so the rename should be atomic and there > is no window for losing the original file. Oh, I didn't realize this was the case. Yes, if there are atomic renames, feel free to use sed -i. (IIRC, support for sed -i was first introduced in sarge; no need for a versioned dep, I think.) -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. [EMAIL PROTECTED] http://www.debian.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]