Subject: Re: bug#29362: 27.0.50; copy-file no longer copying when second argument is a directory

From: Philipp Stephani <[email-masked]>
Date: Sun, 19 Nov 2017 21:40:04 +0000

Bryan M. Kramer <[email-masked]> schrieb am So., 19. Nov. 2017 um
22:09 Uhr:

>
> copy-file help states if second argument is a directory, it will create
> a properly named file in the directory. This is no longer the case in
> this version of emacs.
>

This is working as intended, see NEWS:

** Several functions that create or rename files now treat their
destination argument specially only when it is a directory name, i.e.,
when it ends in '/' on GNU and other POSIX-like systems.  When the
destination argument D of one of these functions is an existing
directory and the intent is to act on an entry in that directory, D
should now be a directory name.  For example, (rename-file "e" "f/")
renames to 'f/e'.  Although this formerly happened sometimes even when
D was not a directory name, as in (rename-file "e" "f") where 'f'
happened to be a directory, the old behavior often contradicted the
documentation and had inherent races that led to security holes.  A
call like (rename-file C D) that used the old, undocumented behavior
can be written as (rename-file C (file-name-as-directory D)), a
formulation portable to both older and newer versions of Emacs.
Affected functions include 'add-name-to-file', 'copy-directory',
'copy-file', 'format-write-file', 'gnus-copy-file',
'make-symbolic-link', 'rename-file', 'thumbs-rename-images', and
'write-file'.