[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: design question, why not always use 'cp --remove-destination'?
From: |
Frederik Eaton |
Subject: |
Re: design question, why not always use 'cp --remove-destination'? |
Date: |
Wed, 23 Aug 2006 01:57:23 +0100 |
User-agent: |
mutt-ng/devel-r472 (Debian) |
Thanks to everyone for the answers.
Frederik
On Tue, Aug 22, 2006 at 12:29:24PM -0700, Paul Eggert wrote:
> Frederik Eaton <address@hidden> writes:
>
> > is there a reason why users wouldn't always want a "copyFile"
> > function to remove the destination first?
>
> Lots and lots and lots of reasons. For example, the destination file
> might be read-only, and the user might want the copy to fail in that
> case. A copyFile that first removed the destination would mistakenly
> succeed on a read-only destination.
>
> Another example: "cp infile /dev/null". Replacing /dev/null with a
> regular file is a bad idea, in my experience. (And I have experience. :-)
>
> This may help to explain why Unix does not have a standard copy_file
> function. Copying a file is harder than it looks, and there are lots
> of options. Good luck with your attempt to simplify things for Haskell.
>
--
http://ofb.net/~frederik/
- design question, why not always use 'cp --remove-destination'?, Frederik Eaton, 2006/08/22
- Re: design question, why not always use 'cp --remove-destination'?, Krasimir Angelov, 2006/08/22
- Re: design question, why not always use 'cp --remove-destination'?, Eric Blake, 2006/08/22
- Re: design question, why not always use 'cp --remove-destination'?, Jim Meyering, 2006/08/22
- Re: design question, why not always use 'cp --remove-destination'?, Andreas Schwab, 2006/08/22
- Re: design question, why not always use 'cp --remove-destination'?, Paul Eggert, 2006/08/22
- Re: design question, why not always use 'cp --remove-destination'?,
Frederik Eaton <=