text
stringlengths 0
234
|
|---|
Archive => False),
|
Reserved => (others => ASCII.NUL),
|
Cluster_H =>
|
Unsigned_16
|
(Shift_Right
|
(Unsigned_32
|
(New_Dir.Start_Cluster) and 16#FFFF_0000#, 16)),
|
Time => 0,
|
Date => 0,
|
Cluster_L => Unsigned_16 (New_Dir.Start_Cluster and 16#FFFF#),
|
Size => 0);
|
Dot_Dot :=
|
(Filename => (1 .. 2 => '.', others => ' '),
|
Extension => (others => ' '),
|
Attributes => (Read_Only => False,
|
Hidden => False,
|
System_File => False,
|
Volume_Label => False,
|
Subdirectory => True,
|
Archive => False),
|
Reserved => (others => ASCII.NUL),
|
Cluster_H =>
|
Unsigned_16
|
(Shift_Right
|
(Unsigned_32 (Handle.Start_Cluster) and 16#FFFF_0000#, 16)),
|
Time => 0,
|
Date => 0,
|
Cluster_L => Unsigned_16 (Handle.Start_Cluster and 16#FFFF#),
|
Size => 0);
|
Handle.FS.Window (0 .. 31) := To_Data (Dot);
|
Handle.FS.Window (32 .. 63) := To_Data (Dot_Dot);
|
Handle.FS.Window (64 .. 95) := (others => 0);
|
Ret := Handle.FS.Write_Window;
|
Close (Handle.all);
|
return Ret;
|
end Create_Subdir;
|
----------------------
|
-- Create_File_Node --
|
----------------------
|
function Create_File_Node
|
(Dir : FAT_Node;
|
Name : FAT_Name;
|
New_File : out FAT_Node) return Status_Code
|
is
|
Handle : FAT_Directory_Handle_Access;
|
Ret : Status_Code;
|
begin
|
Ret := Dir.FAT_Open (Handle);
|
if Ret /= OK then
|
return Ret;
|
end if;
|
Ret := Allocate_Entry
|
(Parent => Handle,
|
Name => Name,
|
Attributes => (Read_Only => False,
|
Hidden => False,
|
System_File => False,
|
Volume_Label => False,
|
Subdirectory => False,
|
Archive => True),
|
E => New_File);
|
Close (Handle.all);
|
if Ret /= OK then
|
return Ret;
|
end if;
|
return Ret;
|
end Create_File_Node;
|
-------------------
|
-- Delete_Subdir --
|
-------------------
|
function Delete_Subdir
|
(Dir : FAT_Node;
|
Recursive : Boolean) return Status_Code
|
is
|
Parent : FAT_Node;
|
Handle : FAT_Directory_Handle_Access;
|
Ent : FAT_Node;
|
Ret : Status_Code;
|
begin
|
Ret := Dir.FAT_Open (Handle);
|
if Ret /= OK then
|
return Ret;
|
end if;
|
while Read (Handle.all, Ent) = OK loop
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.