fileutil - basic routines to interface to the filesytem
This class contains a few routines to manage files. The
routines placed here are resonably general and should be
possible to implement in most operating systems.
if Filesystem.Exist(Filename) then
Boris Magnusson, Lund University.
FileStatus - routines to access Unix filesystem info about a
OS related operations on Simula files that can not, or is
not convenient to do through the Simula File 'Access'
Operations placed in this class are intended to be
'portable' and implementable in most operating systems.
Boolean procedure Exist(T);
text T; ! Full name of the file.;
Return true if a file exist. The parameter is the filename
of the file. Note: This routine returns true even if the
file can not be opened because of access priviliges.
Boolean procedure Delete(t);
text t; ! Full name of the file.;
This procedure deletes a file if it exists. Returns false if
the file did not exist or couldn't be deleted (access
Boolean procedure Rename(told,tnew);
text told; ! Full filename as the file is currently
text tnew; ! Full, new, name the file will be known as.;
This procedure renames a file. Returns false if it couldn't
be done. Notice that files can not be moved between
filesystems through renaming.
integer procedure FileNumber(f);
ref(file) f; ! Open Simula file.;
This procedure returns the Unix filenumber (0,1,2,..) of an
open Simula file. Returns -1 if it is not open. Useful when
interfacing to Unix system software.