[Bug ada/63222] Ada.Directories.Delete_File refuses to delete dangling symlinks

2015-12-06 Thread ebotcazou at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63222

Eric Botcazou  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-12-06
 CC||ebotcazou at gcc dot gnu.org
 Ever confirmed|0   |1
   Severity|normal  |enhancement

[Bug ada/63222] Ada.Directories.Delete_File refuses to delete dangling symlinks

2015-07-22 Thread pavel at zhukoff dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63222

Pavel Zhukov  changed:

   What|Removed |Added

 CC||pavel at zhukoff dot net

--- Comment #1 from Pavel Zhukov  ---
*** Bug 66972 has been marked as a duplicate of this bug. ***


[Bug ada/63222] Ada.Directories.Delete_File refuses to delete dangling symlinks

2015-07-22 Thread pavel at zhukoff dot net
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63222

--- Comment #2 from Pavel Zhukov  ---
If symlink is broken Ada.Directories.Exists returns False (actually it's
because stat64 returns ENOENT in __gnat_stat). 

Easy to reproduce:
mkdir 'test' && cd 'test' && touch target && ln -s target link && rm target &&
cd - && ./del

where del is:
with Ada.Directories;
procedure del is 
begin
  Ada.Directories.Delete_Tree ("test");
end del; 


The problem is even worse if Ada.Direcotiries.Delete_Tree was called and
symlink's target was deleted before the symlink itself.
raised ADA.IO_EXCEPTIONS.USE_ERROR : directory tree rooted at ".uuid" could not
be deleted