Re: :del and symlinks
Bram Moolenaar <[email protected]> Sat, 02 Oct 2004 21:51:03 +0200
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
> Tim Hemel wrote:
>
> > On Fri, 2004-09-17 at 20:37, Bram Moolenaar wrote:
> > > Tim Hemel wrote:
> > >
> > > > I have experienced a problem with symlinks with aap 1.068.
> > > >
> > > > If i use :del {r}{f} dir and dir contains a symlink that points to
> > > > a non-existing file, aap complains and stops.
>
> [...]
>
> > I did some more research and I found the real problem. The directory
> > that I am trying to delete contains a symlink to /tmp, which contains
> > file that are owned by the root user. The aap log file says that it
> > tried to remove those files:
> >
> > note: Could not delete "mydir"[Errno 1] Operation not permitted:
> > 'mydir/xyz/abc/mapping-root'
> >
> > It turns out that mydir/xyz/abc is a symlink to /tmp and the
> > mapping-root file is owned by root.
> >
> > I do not like the idea of aap following these symlinks to delete my
> > files in /tmp (because I assume that those were deleted now.. :( )
>
> I suppose what you expect is that the symlink is deleted, not the file
> or directory it refers to. The Unix rm command works that way.
>
> The problem is that os.path.isdir() returns True for a symlink to a
> directory. This confuses Aap. This requires checking for a link as
> well.
>
> I'll make it delete the symlink.
I have implemented this now and released version 1.071.
--
Q: What is a patch 22?
A: A patch you need to include to make it possible to include patches.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ Project leader for A-A-P -- http://www.A-A-P.org ///
\\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl