directoryfile - rouitnes to read directory filenames
DirectoryFile is used to read the entries in a file-system
directory. The File is open before access. Entries are
returend one by one.
external class DirectoryFile;
text t; integer i;
Directory:- new DirectoryFile(SomeName);
if not Directory.open the
error( Can't open :"& SomeName)"
while Directory.NextEntry do
Boris Magnusson, Lund University.
FileStatus - routines to access Unix filesystem info about a
After succefully opened, the filename of a directory can be
read sequentially by calling NextEntry to advance and
EntryName to access the name of the file.
This class only reports the name of the files in a
directory. See the class FileStatus for getting information
about the indiviual files.
Init: DF :- new DirectoryFile("aDirectoryFilename") ;
Sequencing: (Open (NextEntry EntryName)* Close)*
Boolean procedure Open;
Return True if the file is a directory and can be opened for
Boolean procedure Close;
Returns true if the file could be closed succesfully.
Boolean procedure NextEntry;
Advances to the next entry in the directory. Returns True if
there was yet another entry and false when there are no more
text procedure Entryname;
Returns the "filename" of the current Entry in the