FileSystem not deleting symlinks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

FileSystem not deleting symlinks

Damien Cassou-2
The FileSystem library uses DeleteVisitor and PostorderGuide
(depth-first) to delete a directory and all its children. All its
children? No. Symlinks are protected from deletion:

DeleteVisitor>>visit: aReference
  PostorderGuide
    show: aReference
    to: self
    selecting: [ :entry | entry isSymlink not ]


I didn't find any unit-test or documentation about why symlinks are
excluded from deletion. I don't see any reason. I'm quite sure the
author had a reason to do that but I don't know which one.

Anybody has an idea?

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: FileSystem not deleting symlinks

Damien Pollet
Perhaps a risk of deleting the symlink target instead of the link itself?

On 20 May 2015 at 15:46, Damien Cassou <[hidden email]> wrote:
The FileSystem library uses DeleteVisitor and PostorderGuide
(depth-first) to delete a directory and all its children. All its
children? No. Symlinks are protected from deletion:

DeleteVisitor>>visit: aReference
  PostorderGuide
    show: aReference
    to: self
    selecting: [ :entry | entry isSymlink not ]


I didn't find any unit-test or documentation about why symlinks are
excluded from deletion. I don't see any reason. I'm quite sure the
author had a reason to do that but I don't know which one.

Anybody has an idea?

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill




--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet
Reply | Threaded
Open this post in threaded view
|

Re: FileSystem not deleting symlinks

Sean P. DeNigris
Administrator
Damien Pollet wrote
Perhaps a risk of deleting the symlink target instead of the link itself?
IIRC before the VM changes to distinguish symlinks, that was exactly the dangerous situation. If you had a symlink to your home directory in a folder which you deleted from Pharo... bye bye :/
Cheers,
Sean