Types
(* TRUE if end of directory is reached *)
(* TRUE if current entry is a directory *)
(* Result. 0 means no error. *)
(* File or directory name *)
(* Path that has been set *)
Directory rider record. Holds data of a single file or directory entry while reading contents of a directory.
Variables
Procedures
Close a directory.
MUST BE CALLED to avoid leaking C directory streams.
!TODO add this to finalization.
Returns TRUE if the file with the given name exists.
Initiates reading the directory with the given path.
After the call to First the directory entry rider r
holds data about the first entry of the directory at path
. Check if r.res = 0
to make sure First
was successful. Use Next
with the same r
and used check r.eod
to see when it is time to stop reading the directory.
Returns a full path to the current working directory.
Returns TRUE if the given file name refers to a directory.
Reads the next directory entry after the one refered by r
.
First call First(r, path)
with the same r
and a path to a directory. Then use r.eod
and Next(r)
to iterate through the entries.
Starts reading directory contents from the beginning.
This module includes procedures to read directory contents.