Oberon || Library || Module Index || Search Engine || Definition || Module
CONST regular = 0; directory = 1; symlink = 2; other = 3;
PROCEDURE GetFileType(pathname: ARRAY OF CHAR; VAR ftype: SHORTINT; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetSize(pathname: ARRAY OF CHAR; VAR size: LONGINT; errors: RelatedEvents.Object) : BOOLEAN; PROCEDURE GetTimestamp(pathname: ARRAY OF CHAR; VAR timestamp: ARRAY OF CHAR; errors: RelatedEvents.Object) : BOOLEAN;
PROCEDURE List(s: Streams.Stream; pathname, relpath, pattern: ARRAY OF CHAR; long: BOOLEAN; errors: RelatedEvents.Object) : BOOLEAN;
GetFileType returns a simplified file type of pathname. Files of type other should usually neither be accessed nor shown by FTP services.
GetSize returns the size of pathname in bytes under the assumption of a binary transfer mode. GetTimestamp returns, in conformance to FTPCommands.mdtm, the time of the last modification of pathname in the form YYYYMMDDHHMMSS.
List prints to s,
Lines output resemble that of ``/bin/ls -la'' if long is set to TRUE, and to ``/bin/ls'' otherwise. However,
The original pathname in pathname is never revealed. Instead relpath is printed, if given, and, in case of a directory listing, the filename inside a directory is provided. The wildcard pattern pattern is, if given for a directory, matched against filenames inside of directories and works as filter. Wildcard patterns are interpreted by ScanDir but locally only against filenames found inside the directory specified by pathname. Multi-level patterns like ``*/*'' do not work.
All occurences of newlines in directory entries are replaced by null bytes when being output to s.
drwxr-xr-x 3 0 512 May 7 13:51 . drwxr-xr-x 3 0 512 May 7 13:51 .. -rw-r--r-- 1 0 7 May 7 13:51 textfile drwxr-xr-x 2 0 512 May 7 13:51 subdir lrwxrwxrwx 1 0 8 May 7 13:51 link -> textfileThe same directory as shown by /bin/ls -la:
total 10 drwxrwxr-x 3 afb sai 512 May 7 15:51 . drwxrwxr-x 3 root root 512 May 7 15:51 .. lrwxrwxrwx 1 afb sai 8 May 7 15:51 link -> textfile drwxrwxr-x 2 afb sai 512 May 7 15:51 subdir -rw-rw-r-- 1 afb sai 7 May 7 15:51 textfile
The directory listings by this module do not rely on any external programs (like /bin/ls) but provide, to stay compatible with a large number of FTP clients, listings that look like those generated by /bin/ls except that
Oberon || Library || Module Index || Search Engine || Definition || Module