-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2007, AdaCore --
+-- Copyright (C) 1998-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
end Check_For_Standard_Dirs;
end Basename;
- -- Start processing for Base_Name
+ -- Start of processing for Base_Name
begin
if Path'Length <= Suffix'Length then
procedure Change_Dir (Dir_Name : Dir_Name_Str) is
C_Dir_Name : constant String := Dir_Name & ASCII.NUL;
-
- function chdir (Dir_Name : String) return Integer;
- pragma Import (C, chdir, "chdir");
-
begin
if chdir (C_Dir_Name) /= 0 then
raise Directory_Error;
-- Remove the directory only if it is empty
if not Recursive then
- rmdir (C_Dir_Name);
-
- if GNAT.OS_Lib.Is_Directory (Dir_Name) then
+ if rmdir (C_Dir_Name) /= 0 then
raise Directory_Error;
end if;
Str (1 .. Last) /= ".."
then
Remove_Dir (Str (1 .. Last), True);
- Remove_Dir (Str (1 .. Last));
end if;
else