text
stringlengths
0
234
overriding procedure Reset (Dir : in out VFS_Directory_Handle);
-- Resets the handle to the first node
overriding procedure Close (Dir : in out VFS_Directory_Handle);
-- Closes the handle, and free the associated resources.
function Open
(Path : String;
Handle : out Any_Directory_Handle)
return Status_Code;
function Open
(Path : String;
Mode : File_Mode;
Handle : out Any_File_Handle)
return Status_Code;
Mount_Points : Mount_Array;
Handles : array (1 .. 2) of aliased VFS_Directory_Handle;
function Name (Point : Mount_Record) return Mount_Path;
procedure Set_Name (Point : in out Mount_Record;
Path : Mount_Path);
procedure Split
(Path : String;
FS : out Any_Filesystem_Driver;
Start_Index : out Natural);
----------
-- Open --
----------
function Open
(File : in out File_Descriptor;
Name : String;
Mode : File_Mode)
return Status_Code
is
Ret : Status_Code;
begin
if Is_Open (File) then
return Invalid_Parameter;
end if;
Ret := Open (Name, Mode, File.Handle);
if Ret /= OK then
File.Handle := null;
end if;
return Ret;
end Open;
-----------
-- Close --
-----------
procedure Close (File : in out File_Descriptor) is
begin
if File.Handle /= null then
File.Handle.Close;
File.Handle := null;
end if;
end Close;
-------------
-- Is_Open --
-------------
function Is_Open
(File : File_Descriptor)
return Boolean
is (File.Handle /= null);
-----------
-- Flush --
-----------
function Flush
(File : File_Descriptor)
return Status_Code
is
begin
if File.Handle /= null then
return Convert (File.Handle.Flush);
else
return Invalid_Parameter;
end if;
end Flush;
----------
-- Size --
----------
function Size
(File : File_Descriptor)
return File_Size
is
begin
if File.Handle = null then