* delete-file fails on symlinks to directories
@ 2004-12-07 6:43 David Casperson
0 siblings, 0 replies; only message in thread
From: David Casperson @ 2004-12-07 6:43 UTC (permalink / raw)
In GNU Emacs 21.3.1 (sparc-sun-solaris2.8, X toolkit)
of 2003-05-25 on csfac007.unbc.ca
configured using `configure --prefix=/ld1/local'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: en_US.ISO8859-1
value of $LC_CTYPE: en_US.ISO8859-1
value of $LC_MESSAGES: C
value of $LC_MONETARY: en_US.ISO8859-1
value of $LC_NUMERIC: en_US.ISO8859-1
value of $LC_TIME: en_US.ISO8859-1
value of $LANG: en_US.ISO8859-1
locale-coding-system: iso-latin-1
default-enable-multibyte-characters: t
The delete-file command claims that:
| Delete file named FILENAME. If it is a symlink, remove the symlink.
| If file has multiple names, it continues to exist with the other names.
However delete-file will not delete a symlink to a directory.
For instance:
(make-directory "./here")
(make-symbolic-link "here" "link-to-here")
(delete-file "link-to-here")
fails
The
offending code in fileio.c is
--------------------------------------------------
GCPRO1 (filename);
if (!NILP (Ffile_directory_p (filename)))
Fsignal (Qfile_error,
Fcons (build_string ("Removing old name: is a directory"),
Fcons (filename, Qnil)));
UNGCPRO;
--------------------------------------------------
as the documentation for file-directory-p clearly says that it does NOT
distinguish between directories and symlinks to directories.
Clearly delete-file does not agree with its documentation. There may
reasons (non-UNIX operating systems?) for leaving the functionality as
is, but it is also inconsistent with higher level functions such as
dired-delete-file .
Your sincerely,
David Casperson
--
Dr. David Casperson | casper@unbc.ca
Computer Science | x6672 Fax.5544
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-12-07 6:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-07 6:43 delete-file fails on symlinks to directories David Casperson
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).