[Top][All Lists]

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

Re: can't delete symlinks if point to non empty dir

From: Kevin Rodgers
Subject: Re: can't delete symlinks if point to non empty dir
Date: Mon, 20 Mar 2006 09:11:06 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Dan Jacobson wrote:
> Gentlemen,
>   delete-file is an interactive built-in function.
>   (delete-file FILENAME)
>   Delete file named FILENAME.  If it is a symlink, remove the symlink.
> Well bad news. If it is a symlink to a non-empty directory, then I'm
> afraid the user will have to call in real rm(1).
> Already we see that "If it is a symlink, remove the symlink." doesn't
> describe what is really happening: certainly wrongly checking
> first about other things than being a symlink, as seen by the
> Lisp error: (file-error "Removing old name: is a directory" "/tmp/w/etc")
> Go ahead,
> ls -s some_non_empty_directory target, e.g., "ln -s /etc ."
> Now try dired-flag-file-deletion, dired-do-flagged-delete (d,x) on it.
> emacs-version"21.4.1"

Confirmed, in
GNU Emacs 21.4.1 (i386-pc-solaris2.8, X toolkit, Xaw3d scroll bars) of 2005-09-21 on daedal

dired-delete-file correctly determines that /tmp/etc is a symbolic link
to /etc, so it calls delete-file.  But delete-file apparently gets
confused and signals the error because /etc is a directory.

> P.S.,(describe-function (quote car))
>   car is a built-in function.
>   (car LIST)
>   Return the car of LIST.  If arg is nil, return nil.
>   Error if arg is not nil and not a cons cell.  See also `car-safe'.
> What a perfect place to say what "car" means, instead of the snide
> recursive definition. Yes, there also is a lisp manual, still...

There was a lengthy discussion about this recently, and if I remember
correctly it was decided to leave it mostly alone.

Kevin Rodgers

reply via email to

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