|
From: | Mikael Magnusson |
Subject: | Re: cp doesn't overwrite fifos |
Date: | Fri, 21 Oct 2005 20:06:59 +0200 (CEST) |
On Fri, 21 Oct 2005, Jim Meyering wrote:
Mikael Magnusson <address@hidden> wrote:I have a file "a" and a fifo "b". Running "cp a b" prompts "cp: overwrite b?", but answering yes just writes the contents of "a" into the fifo. IfIn this particular case, using the gnu-specific --remove-destination option will make it do what you want.
Ah, i missed that one. What is the advantage of truncating the existing file instead of removing it first? I guess the man page does state that it won't remove existing files when it says existing files are opened with O_WRONLY | O_CREAT, but I didn't realize the implications of this for fifos and hardlinks.
-- Mikael Magnusson
[Prev in Thread] | Current Thread | [Next in Thread] |