bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#49644: 27.2; copy-directory fails when Unix socket file is present i


From: Pierre Rouleau
Subject: bug#49644: 27.2; copy-directory fails when Unix socket file is present in the source directory tree
Date: Mon, 19 Jul 2021 15:50:32 -0400


> On Jul 19, 2021, at 12:10 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Pierre Rouleau <prouleau001@gmail.com>
>> Date: Mon, 19 Jul 2021 11:04:39 -0400
>> 
>> There is no Emacs crash involved here.  It's just a feature request.
>> 
>> Try `copy-directory' on a directory tree that contains one Unix socket.
>> Something like "~/elpa/gnupg" which often contains Unix socket files.
>> This will fail with an error stating that the Unix socket cannot be
>> copied.
>> 
>> Although its true that Unix sockets cannot be copied, it would be nice
>> to offer the users the ability to copy the directory tree anyway,
>> skipping the Unix socket files.
>> 
>> The function `copy-directory' does not provide a mechanism to skip the
>> copy of such files, so it becomes impossible to copy a directory tree
>> that contains such a file.  It would be useful to add argument to
>> provide the ability to skip such files.   Currently, the only way is to
>> override or advise the function `copy-file' when using `copy-directory'.
> 
> I think it would be more useful to add an optional behavior whereby
> any file that cannot be copied for some reason would not terminate the
> copy.  There's no need to allow such tolerance only for sockets.  I
> could imagine a huge file that cannot be copied because the target
> directory doesn't have enough space, for example.  Perhaps ask the
> user whether to continue, when a copy fails, or provide a user option

I agree that supporting more use cases would be beneficial. 
It would be nice that no prompting is required though or at least that it would 
be possible to use the function in a non-interactive way.

Providing user-options might be the way. 
That would leave the signature intact and yet would allow introducing several 
new behaviours, 
whether prompting is used or not, what type of condition is ignored, etc…. 

For my use case I would at least need to be able to set a copy directory 
user-option to prevent copy-file from stopping on a Unix socket.




reply via email to

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