text stringlengths 0 234 |
|---|
is |
L : HALFS.File_Size := T'Size / 8; |
begin |
if File.Handle /= null then |
return Convert (File.Handle.Read (Value'Address, L)); |
else |
return Invalid_Parameter; |
end if; |
end Generic_Read; |
---------- |
-- Open -- |
---------- |
function Open |
(Dir : in out Directory_Descriptor; |
Name : String) |
return Status_Code |
is |
Ret : Status_Code; |
begin |
if Dir.Handle /= null then |
return Invalid_Parameter; |
end if; |
Ret := Open (Name, Dir.Handle); |
if Ret /= OK then |
Dir.Handle := null; |
end if; |
return Ret; |
end Open; |
----------- |
-- Close -- |
----------- |
procedure Close (Dir : in out Directory_Descriptor) is |
begin |
if Dir.Handle /= null then |
Dir.Handle.Close; |
end if; |
end Close; |
---------- |
-- Read -- |
---------- |
function Read (Dir : in out Directory_Descriptor) |
return Directory_Entry |
is |
Node : Any_Node_Handle; |
Status : Status_Code; |
begin |
if Dir.Handle = null then |
return Invalid_Dir_Entry; |
end if; |
Status := Convert (Dir.Handle.Read (Node)); |
if Status /= OK then |
return Invalid_Dir_Entry; |
end if; |
declare |
Name : constant String := Node.Basename; |
Ret : Directory_Entry (Name_Length => Name'Length); |
begin |
Ret.Name := Name; |
Ret.Subdirectory := Node.Is_Subdirectory; |
Ret.Read_Only := Node.Is_Read_Only; |
Ret.Hidden := Node.Is_Hidden; |
Ret.Symlink := Node.Is_Symlink; |
Ret.Size := Convert (Node.Size); |
Node.Close; |
return Ret; |
Function Definition: function To_Data is new Ada.Unchecked_Conversion |
Function Body: (FAT_Directory_Entry, Entry_Data); |
function To_Data is new Ada.Unchecked_Conversion |
(VFAT_Directory_Entry, Entry_Data); |
function Find_Empty_Entry_Sequence |
(Parent : access FAT_Directory_Handle; |
Num_Entries : Natural) return Entry_Index; |
-- Finds a sequence of deleted entries that can fit Num_Entries. |
-- Returns the first entry of this sequence |
-------------- |
-- Set_Size -- |
-------------- |
procedure Set_Size |
(E : in out FAT_Node; |
Size : FAT_File_Size) |
is |
begin |
if E.Size /= Size then |
E.Size := Size; |
E.Is_Dirty := True; |
end if; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.