Lcd wrote:
> On 16 January 2016, Bram Moolenaar <[email protected]> wrote:
> >
> > Patch 7.4.1107
> > Problem: Vim can create a directory but not delete it.
> > Solution: Add an argument to delete() to make it possible to delete a
> > directory, also recursively.
> > Files: src/fileio.c, src/eval.c, src/proto/fileio.pro,
> > src/testdir/test_delete.vim, src/testdir/test_alot.vim,
> > runtime/doc/eval.txt
> [...]
> > *** ../vim-7.4.1106/runtime/doc/eval.txt 2016-01-15 20:48:09.862003231
> > +0100
> > --- runtime/doc/eval.txt 2016-01-16 20:34:22.280259614 +0100
> > ! delete({fname} [, {flags}])
> > *delete()*
> > ! Without {flags} or with {flags} empty: Deletes the file by the
> > ! name {fname}.
> > !
> > ! When {flags} is "d": Deletes the directory by the name
> > ! {fname}. This fails when {fname} is not empty.
> > !
> > ! When {flags} is "rf": Deletes the directory by the name
> > ! {fname} and everything in it, recursively. Be careful!
> [...]
>
> There seems to be a serious problem with delete("dir", "rf"):
> if "dir" has a symlink descendant then (1) the symlink is followed
> (that is, the content of the directory symlink points to is deleted
> recursively), (2) the symlink is not deleted, and (3) the operation
> returns -1, signifying failure. I believe neither of this is expected,
> or useful.
I believe you mean that a symbolic link to a directory does not work as
expected. The "rm" manual page actually does not mention symbolic links
and what it does with them.
Currently delete("link") deletes the link, not the file it points to. I
think that is good. So we should do the same for when the symbolic link
points to a directory.
Hmm, would that require: delete("dirlink", 'd') ?
Or can it be done with delete("dirlink") ?
It appears "rm dirlink" works, so we best follow that.
--
Our job was to build a computer information system for the branch banks. We
were the perfect people for the job: Dean had seen a computer once, and I had
heard Dean talk about it.
(Scott Adams - The Dilbert principle)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.