Download MIT Scheme Reference Manual
Transcript
Chapter 15: Operating-System Interface 211 “parent” of the previous one. up corresponds to the file ‘..’ in unix and PC file systems. (The following note does not refer to any file system currently supported by MIT Scheme, but is included for completeness.) In file systems that do not have “hierarchical” structure, a specified directory component will always be a list whose first element is absolute. If the system does not support directories other than a single global directory, the list will have no other elements. If the system supports “flat” directories, i.e. a global set of directories with no subdirectories, then the list will contain a second element, which is either a string or wild. In other words, a non-hierarchical file system is treated as if it were hierarchical, but the hierarchical features are unused. This representation is somewhat inconvenient for such file systems, but it discourages programmers from making code depend on the lack of a file hierarchy. name A string, which is a literal component; or the symbol wild, meaningful only when used in conjunction with the directory reader. type A string, which is a literal component; or the symbol wild, meaningful only when used in conjunction with the directory reader. version An exact positive integer, which is a literal component; the symbol newest, which means to choose the largest available version number for that file; the symbol oldest, which means to choose the smallest version number; or the symbol wild, meaningful only when used in conjunction with the directory reader. In the future some other possible values may be added, e.g. installed. Note that currently no file systems support version numbers; thus this component is not used and should be specified as #f. make-pathname host device directory name type version procedure Returns a pathname object whose components are the respective arguments. Each argument must satisfy the restrictions for the corresponding component, which were outlined above. (make-pathname #f #f ’(absolute "usr" "morris") "foo" "scm" #f) ⇒ #[pathname 67 "/usr/morris/foo.scm"] pathname-host pathname pathname-device pathname pathname-directory pathname pathname-name pathname pathname-type pathname pathname-version pathname Returns a particular component of pathname. procedure procedure procedure procedure procedure procedure