emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in copy-directory


From: Chong Yidong
Subject: Re: bug in copy-directory
Date: Wed, 09 Feb 2011 11:02:00 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> copy-directory already has many arguments, and adding one which will
> (almost) always need to be passed doesn't sound too attractive.

I'm not sure that's true.  Suppose you want to do something like this:

  Move the files /foo/file-1, /foo/file-2, etc., so they are found
  in /bar: /bar/file-1, /bzr/file-2, etc.

Currently, you can do this with (copy-directory "/foo" "/bar").  Even if
/bar exists, that is OK.

If you want to use copy-directory with cp-like semantics (via a
copy-as-subdir argument, or if we give copy-directory such behavior by
default), that imposes an extra step: you have to check if /bar already
exists.  If it exists, you have to do take some non-trivial steps to
either delete it or merge the contents of /foo into /bar.

In the shell, of course, you just do "cp -r /foo/* /bar".  That's
because cp acts on both files and directories; copy-directory only
copies directories.  This implies that giving copy-directory cp-like
semantics might be a mistake.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]