FileSystem not deleting symlinks
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
Perhaps a risk of deleting the symlink target instead of the link itself? On 20 May 2015 at 15:46, Damien Cassou <damien.cassou@inria.fr> 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
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 -- View this message in context: http://forum.world.st/FileSystem-not-deleting-symlinks-tp4827629p4827725.htm... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (3)
-
Damien Cassou -
Damien Pollet -
Sean P. DeNigris