emacs-devel
[Top][All Lists]
Advanced

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

Re: copy-directory


From: Michael Albinus
Subject: Re: copy-directory
Date: Sun, 04 Oct 2009 21:58:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Please don't rely on the `chown' command being available for the
> preserve-uid-gid option.  It is only available on Posix platforms.
> Instead, please add a primitive to do this from within Emacs.

I know that. But I do not know how important it is on W32.

> And one more comment about the code:
>
>       (mapc
>        (lambda (file)
>        (if (file-directory-p file)
>            (copy-directory file newname keep-time preserve-uid-gid parents)
>          (copy-file file newname t keep-time preserve-uid-gid)))
>        ;; We do not want to delete "." and "..".
>        (directory-files
>       directory 'full "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
>
> Instead of this complicated regexp, isn't it easier to just filter out
> "." and ".." by adding a suitable comparison to the function you map
> of the files?  I find it not easy to convince myself that the regexp
> indeed matches every valid file name but those two.

I've stolen it from `dired-re-no-dot'. One option would be to add a
similar regexp to files.el, given that I have used it also in
`delete-directory'? (And I will need it also in Tramp)

Best regards, Michael.




reply via email to

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