unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: "tramp-devel@gnu.org" <tramp-devel@gnu.org>,
	"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: Tramp and recursive file operations
Date: Wed, 30 Sep 2009 15:56:41 -0400	[thread overview]
Message-ID: <jwvr5to2ox5.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <nqws3g8r1p.fsf@alcatel-lucent.de> (Michael Albinus's message of "Wed, 30 Sep 2009 16:07:14 +0200")

>>> OK. Looking outside dired, there is already delete-directory, good for
>>> empty directories. Maybe we add an optional parameter RECURSIVE?
>> Sounds OK, except for the fact that delete-directory is implemented in
>> C, so you'd have to code the recursion in C as well.
> I've seen that. I'll do my best ...

Maybe the best option is to rename delete-directory to
delete-directory-internal and then implement a new delete-directory in
files.el. using it.

>>> A copy-directory function does not exist. What about allowing the first
>>> parameter of copy-file to be a directory name? This would imply to copy
>>> recursively.
>> If we were starting over from scratch, that would be fine, but I'm
>> afraid that some code somewhere relies on the fact that copy-file only
>> copies files and not directories.  And of course, copy-file is also
>> implemented in C, so you'd have to code the recursion in C as well.
> So we go with copy-directory? Just DIRNAME and NEWNAME as parameters, or
> the other ones from copy-file as well?

Whenever I copy a directory, I always use "cp -a", so I'd be tempted to
say that additional args aren't needed, but that the behavior should
preserve as much as we can (symlinks, gid, mtime, you name it).

> I guess that we dont't need OK-IF-ALREADY-EXISTS, because if directory
> NEWNAME already exists, we create a subdirectory.

I'd tend to disagree here: this kind of behavior is very handy
interactively, but not when called from Lisp code, where you might
prefer an error (at which point you can then choose to call
copy-directory again to the subdirectory, or you may prefer to overlay
the copy on top of the existing tree, tho we don't have any code that
does it for us yet).


        Stefan




  reply	other threads:[~2009-09-30 19:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29 14:39 Tramp and recursive file operations Michael Albinus
2009-09-29 17:49 ` joakim
2009-09-29 20:53 ` Stefan Monnier
2009-09-30  8:06   ` Michael Albinus
2009-09-30 13:45     ` Stefan Monnier
2009-09-30 14:07       ` Michael Albinus
2009-09-30 19:56         ` Stefan Monnier [this message]
2009-10-01 15:53           ` Michael Albinus
2009-09-30 15:52     ` yary
2009-10-02  5:10       ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvr5to2ox5.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=tramp-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).