This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/66972] New: Ada.Directories doesn't recognize dangling symlinks
- From: "pavel at zhukoff dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Jul 2015 18:09:18 +0000
- Subject: [Bug ada/66972] New: Ada.Directories doesn't recognize dangling symlinks
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66972
Bug ID: 66972
Summary: Ada.Directories doesn't recognize dangling symlinks
Product: gcc
Version: 5.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
Assignee: unassigned at gcc dot gnu.org
Reporter: pavel at zhukoff dot net
Target Milestone: ---
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
The similar issue was reported already but closed with UNCONFIRMED:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63222