1
0
mirror of synced 2026-01-13 15:37:38 +00:00
Interlisp.medley/docs/Sun Users Guide/5-MEDLEY-FILES.TEDIT
2020-12-15 19:18:04 -07:00

110 lines
49 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1
Medley for the Sun User's Guide, Release 2.0
1
Medley for the Sun User's Guide, Release 2.0
5. MEDLEY FILE SYSTEMS
1
5. MEDLEY FILE SYSTEMS
1
5. MEDLEY FILE SYSTEMS
6
This chapter discusses the conventions for using files from Medley.
File Naming Conventions(FILE% NAME NIL File% name NIL NIL 31 SUBTEXT conventions)(FILE% NAME NIL Conventions NIL NIL 31 SUBTEXT file% names)
1
In Lisp, a file name(FILE% NAME NIL File% name NIL NIL 31 SUBTEXT Lisp) (pathname(PATHNAME NIL pathname,% Lisp NIL NIL 31)) consists of a collection of fields: the host, directory, name, extension and version. These fields are optional. The standard Lisp syntax for these fields is:
{host}<directory>name.extension;version
The directory field can be a directory path consisting of a sequence of directory and subdirectory components. Slash(SLASH NIL Slash NIL NIL 31)es (/(/ NIL NIL NIL NIL 31)) and right angle brackets(RIGHT% ANGLE% BRACKETS NIL Right% angle% bracket NIL NIL 31) (>(> NIL NIL NIL NIL 31)) can be used to delimit a directory name(DIRECTORY% NAME NIL Directory NIL NIL 31 SUBTEXT name% delimiting); there is no distinction made between them. Square brackets ([](%[%] NIL NIL NIL NIL 31))(BRACKETS NIL Brackets NIL NIL 31 SUBNAME right% angle) (BRACKETS NIL Brackets NIL NIL 31 SUBNAME square)(SQUARE% BRACKETS NIL Square% brackets NIL NIL 31) are not acceptable as directory delimiters.
Duplicated directory delimiters are treated as a single delimiter. Thus, the following two file names specify the same file:
{DSK}<LISP>USERS>FOO.;1
{DSK}</LISP/USERS/>FOO.;1
Hosts that Medley Supports
1
{CORE}({CORE} NIL NIL NIL NIL 31) Creates "files" in memory; useful for quick temporary files
{LPT}({LPT} NIL NIL NIL NIL 31) Creates files that are automatically sent to your printer
{NULL}({NULL} NIL NIL NIL NIL 31) Creates a file that does nothing
{DSK} and Give you access to the Sun's file systems; the rest of the chapter
{UNIX} concentrates on them.
The above hosts are described in more detail in the IRM.
Using SunOS Files from Medley
1
You can access any mounted SunOS(SUNOS NIL SunOS NIL NIL 31 SUBNAME file% system) file system directly from Lisp. The mounted file system is available as an I/O device of the Lisp environment. This file system appears as the local disk of Lisp, even though it may be a remotely mounted file system of networked Sun file servers.
Many of the file devices to which the Medley environment can talk, including PUP, XNS file servers, the {CORE} device, and others, have facilities that are not directly supported by SunOS. For example, many file systems have file version numbers and case insensitive file search conventions.
Medley on the Sun Workstation has two distinct "host" names that can be used to access the SunOS file system. These host names are provided for compatibility with existing applications and tools. They also simultaneously allow natural interaction with the SunOS file system. The names are:
{DSK}({DSK} NIL NIL NIL NIL 32) On the Xerox workstation, {DSK} gave you access to your local hard disk; to use {DSK}, you had to create a directory on each disk partition you wanted to use. On the Sun Workstation, in contrast, the {DSK} device lets you access the file system using similar conventions to those used for {DSK} on the Xerox workstation local disk devices. In particular, {DSK} files have version numbers(VERSION% NUMBERS NIL Version NIL NIL 32 SUBTEXT numbers); {DSK} file name recognition(FILE% NAME NIL File% name NIL NIL 32 SUBNAME recognition) also ignores the case of letters.
{UNIX}({UNIX} (Function) NIL NIL NIL 32) The {UNIX} device lets you use the mounted file systems with the normal naming conventions of the SunOS file system. {UNIX} files do not have version numbers, and the file name recognition treats lowercase letters as distinct from their uppercase equivalents.
File streams(FILE% STREAMS NIL File% streams NIL NIL 32) can be opened or closed on both devices. The reason for having both devices is to more easily support the running of applications that were originally developed on a Xerox workstation, while still allowing new applications to interact more naturally with UNIX.
NOTE: Both {DSK} and {UNIX} work as filters. They act as pointers to a device. On 11xxs, {DSK}foo is the same as {DSK}<lispfiles>foo. On the Sun, {DSK}foo is the same as $HOME/foo ~user/foo.
Common {DSK} and {UNIX} Naming Conventions(CONVENTIONS NIL Conventions NIL NIL 32 SUBNAME common% {DSK}% and% {UNIX})
<EFBFBD><EFBFBD><00>f<EFBFBD> To include a special character (e.g., > or ;) in a file name, precede it with a single quote ('). To include a single quote in a file name, precede it with another single quote. You can quote any of these characters: <, >, ;, ~, and a period (.). The following examples show how the single quote notation on {DSK} and {UNIX} is used.
{DSK} Name From Lisp File Name From SunOS
foo'>bar.baz;1 foo>bar.baz
foo';bar.baz;1 foo;bar.baz
foo''bar.baz;1 foo'bar.baz
<EFBFBD><EFBFBD><00>f<EFBFBD> <20><>{DSK}({DSK} NIL NIL NIL NIL 32 SUBTEXT special% characters) and {UNIX} do not allow you to use either the slash (/) or the NUL character (SPECIAL% CHARACTERS NIL Special% characters NIL NIL 32)(CHARACTERS NIL Characters,% special NIL NIL 32)in file names. Thus, you cannot name files containing these characters.
<EFBFBD><EFBFBD><00>f Both {DSK}({DSK} NIL NIL NIL NIL 32 SUBTEXT special% characters) and {UNIX} can handle the following characters, which were defined as special characters in Medley Release 1.1: backslash (\) and tilde (~).
<EFBFBD><EFBFBD><00>f <09>{DSK} and {UNIX} can distinguish between a file name with a period at the end (e.g., foo.) and a simple file name (e.g., foo). The final period is preceded with a single quote, as shown in the following example:
{DSK} Name From Lisp File Name From SunOS
foo.;1 foo
foo'..;1 foo
<EFBFBD><EFBFBD><00>f <09>On {DSK} and {UNIX}, the C-Shell(C-SHELL NIL C-Shell NIL NIL 32) and SunOS(SUNOS NIL SunOS NIL NIL 32 SUBNAME directory% notations) directory notations (~, ., and ..) are supported in the Lisp directory specification. The tilde(TILDE NIL tilde NIL NIL 32) character (~(~ NIL NIL NIL NIL 32)) is allowed at the very beginning of the directory specification of a pathname. A combination of relative path specifiers (~, ., ..) is supported. The tilde character corresponds to the user's home directory(DIRECTORY NIL Directory NIL NIL 32 SUBNAME home) at login. The period(PERIOD NIL Period NIL NIL 32 SUBTEXT single) (.(%. NIL NIL NIL NIL 32)) corresponds to the current working directory(DIRECTORY NIL Directory NIL NIL 32 SUBNAME working). Two period(PERIOD NIL Period NIL NIL 32 SUBNAME double)s (..(.. NIL NIL NIL NIL 32)) indicates the parent of the current working directory(DIRECTORY NIL Directory NIL NIL 32 SUBNAME parent).
<EFBFBD><EFBFBD><00>f File names are re<>turned by the system (e.g., INFILEP)<29><> in more canonical form. The function which returns the full file name returns it in the canonical form , as in {DSK}<usr>etc> rather than {DSK}/usr/etc/.<2E> This change will make some tools which depend on the conventional file name representation described in the Interlisp-D Reference Manual work correctly on the Medley file system (e.g., COPYFILES).
{DSK}({DSK} NIL NIL NIL NIL 33 SUBNAME naming% conventions) Naming Conventions(NAMING% CONVENTIONS NIL Conventions NIL NIL 33 SUBTEXT {DSK}% naming)
The {DSK} device performs the following file name transformation when actually accessing the SunOS file system:
<EFBFBD><EFBFBD><00>f <09>Mixed case letters are read as such.
<EFBFBD><EFBFBD><00>f <20> File name searches are done case-sensitive first; if a match is not found, the system does a case-insensitive(CASE% SENSITIVITY NIL Case% sensitivity NIL NIL 33) search.
<EFBFBD><EFBFBD><00>f <09>The left angle bracket(LEFT% ANGLE% BRACKET NIL Left% angle% bracket NIL NIL 33)(BRACKET NIL Brackets NIL NIL 33 SUBTEXT left% angle) character (<(< NIL NIL NIL NIL 33)) is translated to a slash (/), the delimiter for the root directory.
<EFBFBD><EFBFBD><00>f {DSK} supports<> <20><>relative pathname<>s(RELATIVE% PATHNAMES NIL Relative% pathnames NIL NIL 33)<29><>.<2E> You can specify relative pathnames by omitting a slash (/) or left angle bracket (<) as the first character in the directory field. For example:
{DSK}foo.fee and {DSK}~/foo.fee are relative to the user's UNIX home directory ( ~/foo.fee).
{DSK}./foo.fee is relative to the user's current working directory (SunOS./foo.fee).
{DSK}../foo.fee is relative to the parent directory of the user's current UNIX working directory (../foo.fee).
The Medley 2.0-S {DSK} device supports the notation in which the three meta characters (', .., and ~) are used together, as shown in the following example:
{DSK}~/../tom/foo.c
In this example, the {DSK} device interprets tom as one of the subdirectories of the parent directory of the user's home directory.
{DSK} also supports the tilde-name (~name) convention. {DSK} interprets {DSK}~tom/foo.c as a file named foo on tom's home directory. In this notation, the user name is case-sensitive (e.g., ~tom and ~Tom are treated as different users).
Version Numbering(VERSION% NUMBERING NIL Version NIL NIL 33 SUBTEXT numbering)
The UNIX file system does not support version numbers in file names; {DSK} emulates versions with a naming convention. (GNU Emacs also uses this convention.) This section explains how {DSK} version numbers are represented in the SunOS file system.
<EFBFBD><EFBFBD><00>f <09>When you create a completely new file, it appears in the SunOS file system without a version number.
{DSK} Name From Lisp File Name From SunOS
bar.baz;1 bar.baz
<EFBFBD><EFBFBD><00>f <09>When you create (from Medley) a file with a version other than 1, Medley adds version numbers to that file name, as a trailing number between tildes, e.g., <20>myfile.~12~<7E> for the twelfth version of myfile.
The following shows some examples of equivalent file names in Lisp and SunOS.
{DSK} Name From Lisp File Name From SunOS
bar.baz;1 bar.baz.~1~
bar.baz;2 bar.baz.~2~
bar.;23 bar.~23~
<EFBFBD><EFBFBD><00>f<EFBFBD> Medley always maintains a versionless file which is hard-linked to the highest extant version of the file (i.e., they are two names for the very same file). This file name does not appear in the {DSK} directory listing.
From {DSK} From SunOS
foo.c;15 foo.c (hard linked with foo.c.~23~)
foo.c;23 foo.c.~15~
foo.c.~23~
<EFBFBD><EFBFBD> <09>Similarly, a file(FILES NIL Files NIL NIL 34 SUBNAME versionless) created in UNIX with no version number is treated by {DSK} as the highest version.
<EFBFBD><EFBFBD><00>f<EFBFBD> When you create a new version of a file, the versionless<73><73><00>$<24>file link is broken, and the versionless file is hard<72><64><00>$<24>linked to the new highest version.
From {DSK} From SunOS
foo.c;15 foo.c (hard linked with foo.c.~24~)
foo.c;22 foo.c.~15~
foo.c;24 (new file) foo.c.~22~ (no link with foo.c)
foo.c.~24~ (new file, link from foo.c)
<EFBFBD><EFBFBD><00>f <09>When you delete the highest version of a file, the versionless file is also deleted. If any older versions of the file remain, a new link is created from the versionless name to the highest version extant. For example, if you have the files
From {DSK} From SunOS
foo.c;1 foo.c (linked to foo.c.~2~)
foo.c;2 foo.c.~1~
foo.c.~2~
and you delete foo.c;2 from {DSK}, the resulting files are:
From {DSK} From SunOS
foo.c;1 foo.c (linked to foo.c.~1~)
foo.c.~1~
<EFBFBD><EFBFBD><00>f <09>When you rename a file, it works the same as deleting the file under the old name then creating it under the new name. For example, if you have the following {DSK} files
From {DSK} From SunOS
foo.c;1 foo.c (linked to foo.c.~2~)
foo.c;2 foo.c.~1~
fee.c;1 foo.c.~2~
fee.c;2 fee.c (linked to fee.c.~2~)
fee.c.~1~
fee.c.~2~
and you rename "foo.c" to "fee.c", your renamed {DSK} files and the linked SunOS files would appear as:
From {DSK} From SunOS
foo.c;1 foo.c (linked to foo.c.~1~)
fee.c;1 foo.c.~1~
fee.c;2 fee.c (linked to fee.c.~3~)
fee.c;3 fee.c.~1~
fee.c.~2~
fee.c.~3~ (renamed file)
<EFBFBD><EFBFBD><00>f <09>When<65><6E> <20>a file has a <20><>name suffix<> that<61><74> is not<> a valid version number (e.g.,<2C><> <20>myfile.~12x~), the suffix is regarded as part of the file name.
From {DSK} From SunOS
myfile.~12x~;1 myfile.~12x~
Pathnames
A pathname(PATHNAME NIL Pathname NIL NIL 35) on {DSK} is always case insensitive(CASE% SENSITIVITY NIL Case% sensitivity NIL NIL 35). When the user specifies a file, the {DSK} device handler first searches for the file with the specified name. If no such file is found, it then searches for a file with the same spelling but different case.
Most Lisp functions, such as FINDFILE(FINDFILE (Function) NIL NIL NIL 35) and INFILEP,which return pathnames return them with the original case when they are applied on files on {DSK} when IL:*DSK-UPPER-CASE-FILE-NAMES* is NIL. If IL:*UPPER-CASE-FILE-NAMES* is not NIL, these functions return only uppercase pathnames. The only exception is the function DIRECTORY , which returns a list of pathnames. The case of the pathnames is controlled by the global variable IL:*UPPER-CASE-FILE-NAMES* in a similar manner to IL:*DSK-UPPER-CASE-FILE-NAMES*.
If a pathname on {DSK} has no directory specification, a tilde-slash(TILDE-SLASH NIL tilde-slash NIL NIL 35) combination (~/(~/ NIL NIL NIL NIL 35)) is used, i.e., the Lisp directory specification {DSK}foo is the equivalent of {UNIX}~/foo.
{UNIX}({UNIX} NIL NIL NIL NIL 35 SUBNAME naming% conventions) Naming Conventions(CONVENTIONS NIL Conventions NIL NIL 35 SUBTEXT UNIX% naming)
For the {UNIX} device, file name translation takes place only on the directory. An initial left angle bracket(LEFT% ANGLE% BRACKET NIL Left% angle% bracket NIL NIL 35) (<(< NIL NIL NIL NIL 35)) is treated as if it were an initial slash (/); both signify a path relative to the SunOS file system root directory; if there is no initial left angle bracket or slash, the directory is relative to the current working directory. Initially this is the working directory where Lisp was started; you can change it using the CHDIR(CHDIR (Function) NIL NIL NIL 35) function, described below. Tilde (~) is translated to the user's home directory.
For example, {UNIX}myfile/abc means the file abc on the ./myfile directory.
The {UNIX} device does not recognize version numbers(VERSION% NUMBERS NIL Version NIL NIL 35 SUBTEXT numbers), does not return them, and ignores them for recognition.
No case translation or recognition is done; upper- and lowercase letters are treated as distinct.
Examples:
{UNIX} Name From Lisp File Name From SunOS
<foo>fee>bar.baz;1 /foo/fee/bar.baz;1
<foo>fee/bar.;1 /foo/fee/bar.;1
<foo/fee> /foo/fee/
</foo/fee/> /foo/fee/
/foo/fee/bar.~1~ /foo/fee/bar.~1~
/foo/fee/ /foo/fee/
In the first two examples the ;1 is treated as part of the file name, not the version number. In the last two examples that translation is not done.
Directories
In places where Lisp expects a directory name, {UNIX} paths must end with a slash (/).
Directory Enumeration(DIRECTORY NIL Directory NIL NIL 36 SUBNAME enumeration)
You cannot use the wildcard character, asterisk(ASTERISK NIL Asterisk NIL NIL 36) (*(* NIL NIL NIL NIL 36)), in subdirectories for either {DSK} ({DSK} NIL NIL NIL NIL 36)or {UNIX}({UNIX} NIL NIL NIL NIL 36) devices. For example
>(DIRECTORY '{DSK}/users/x*/foo)
NIL
Enumeration of files in directories differs between {DSK} and {UNIX} devices. On the {DSK} device, a versionless file which has a link to the highest version file is not enumerated in a directory.
On the {UNIX} device, all files are enumerated in a directory. For instance, if the following SunOS files linked with foo.c.~2~ exist
foo.c
foo.c.~1~
foo.c.~2~
the {DSK} directory enumeration would look like this:
>(DIRECTORY '{DSK}/users/venue/*)
({DSK}/users/venue/foo.c;1
{DSK}/users/venue/foo.c;2)
The {UNIX} directory enumeration, on the other hand, would look like this:
>(DIRECTORY '{UNIX}/users/venue/*)
({UNIX}/users/venue/foo.c
{UNIX}/users/venue/foo.c.~1~
{UNIX}/users/venue/foo.c.~2~)
Directory Creation(DIRECTORY% NIL Directory NIL NIL 36 SUBNAME creation)
{DSK}({DSK} NIL NIL NIL NIL 36) When you write a new file on {DSK}, if the directory named in a pathname does not exist, the {DSK} device handler creates the directory automatically. This feature is provided for compatibility with other Interlisp-D implementations.
If you try to "connect" to a nonexistent directory (using the CONN(CONN (Command) NIL NIL NIL 37) Exec command or the function IL:CNDIR(CNDIR (Function) NIL NIL NIL 37)), Medley returns the message
Nonexistent directory
{UNIX}({UNIX} NIL NIL NIL NIL 37) The {UNIX} device does not support such directory creation. An attempt to create a file on a nonexistent directory results in an error.
{UNIX}/users/venue/foo.c.~2~)
Directory Deletion(DIRECTORY% NIL Directory NIL NIL 37 SUBNAME creation)
Neither {UNIX} nor {DSK} support automatic directory (DIRECTORY% % NIL Directory% NIL NIL 37 SUBNAME deletion)deletion. To delete a directory you must use the SunOS C-Shell command rmdir(RMDIR (UNIX Command) rmdir NIL NIL 37).
Open File Limit
The number of simultaneously open {DSK} and {UNIX} files must fall within the SunOS limits for a process. For OS 3.4, this number of open files(FILES NIL Files NIL NIL 37 SUBNAME open) may be configured, with 30 as the maximum permissible number of open files per process. This means that it is not possible to have more than 30 files open for a process, minus whatever files Medley has open for its own use, at any one time in the Medley system. If you try to open too many files, the system call error number 24, Too many open files, appears in the prompt window.
For OS 4.0, the maximum number of files/processes that can be open at one time is 64, unless your kernel is configured otherwise.
Default Pathname
If no path is given, the {DSK} device defaults to the user's home directory(DIRECTORY NIL Directory NIL NIL 37 SUBNAME home), tilde-slash(TILDE-SLASH NIL Tilde-slash NIL NIL 37) (~/(~/ NIL NIL NIL NIL 37)). The {UNIX} device defaults to the current working directory. This current working directory(DIRECTORY NIL Directory NIL NIL 37 SUBNAME working SUBTEXT changing) can be changed with the CHDIR function. The current working directory is also used to resolve the interpretation of the period(PERIOD NIL Period NIL NIL 37 SUBTEXT single) (.(%. NIL NIL NIL NIL 37)) and double period(PERIOD NIL Period NIL NIL 37 SUBNAME double) (..(.. NIL NIL NIL NIL 37)) specifications at the beginning of a {DSK} pathname.
(IL:CHDIR(CHDIR (Function) NIL NIL NIL 37) PATHNAME) [Function]
Changes the current working directory for the current invocation of Lisp. For example,
(CHDIR "{DSK}~/subdir/")
(OPENSTREAM "{DSK}./foo" ...)
opens the SunOS file ~/subdir/foo.
When PATHNAME does not end with a slash (/) or right angle bracket (>), the whole PATHNAME is treated as a directory name:
(CHDIR '{DSK}<users>local>)
> "{DSK}<users>local>"
(CHDIR '{UNIX} /usr/local)
> "{UNIX}<usr>local>"
If PATHNAME is NIL, CHDIR tries to change the current working directory to the current connected directory. If the directory is connected to devices other than {DSK} or {UNIX}, the error message
Bad Host Name
appears, followed by the host name of the current connected directory.
If the PATHNAME does not exist, the error message
No-Such-Directory
appears followed by the system echo of the pathname.
File Attributes
1
This section describes how the various file attributes(FILE% ATTRIBUTES NIL File% attributes NIL NIL 38) are treated by Lisp on the Sun Workstation and what they translate to in SunOS(SUNOS NIL SunOS NIL NIL 38 SUBTEXT and% file% attributes).
GETFILEINFO obtains file attributes and SETFILEINFO sets the attributes.
WRITEDATE(WRITEDATE (File Attribute) NIL NIL NIL 38) and CREATIONDATE(CREATIONDATE (File Attribute) NIL NIL NIL 38) [File Attributes]
Resets the date to the current time whenever the contents of a file are modified. This only works for the owner of the file. Since UNIX does not naturally support more than one date for file modification, the WRITEDATE and CREATIONDATE are treated identically by Lisp functions OPENSTREAM(OPENSTREAM (Function) NIL NIL NIL 38), OPENFILE(OPENFILE (Function) NIL NIL NIL 38), GETFILEINFO(GETFILEINFO (Function) NIL NIL NIL 38), and by the {DSK}({DSK} NIL NIL NIL NIL 38) and {UNIX}({UNIX} NIL NIL NIL NIL 38) devices.
TYPE(TYPE (File Attribute) NIL NIL NIL 38) [File Attribute]
Sets the TYPE property of files(FILES NIL Files NIL NIL 38 SUBNAME text)(FILES NIL Files NIL NIL 38 SUBNAME binary); normally either TEXT or BINARY. However, UNIX does not distinguish between TEXT(TEXT NIL text% files NIL NIL 38 SUBNAME) and BINARY(BINARY% FILES NIL binary% files NIL NIL 38) files. Normally, programs will infer the type by the file extension, using the Lisp variables DEFAULTFILETYPE(DEFAULTFILETYPE (Variable) NIL NIL NIL 38) and DEFAULTFILETYPELIST(DEFAULTFILETYPELIST (Variable) NIL NIL NIL 38). This is the convention used by Medley. If no file extension is given, the value in DEFAULTFILETYPE is used. SETFILEINFO cannot change the TYPE attribute.
EOL(EOL (File Attribute) NIL NIL NIL 38) [File Attribute]
Returns the end<6E><64><00>$<24>of<6F><66><00>$<24>line convention. Both the {DSK}({DSK} NIL NIL NIL NIL 38) device and {UNIX}({UNIX} NIL NIL NIL NIL 38) use line feed(LINE% FEED NIL Line% feed NIL NIL 38) (LF) as the default EOL convention(EOL% CONVENTION NIL End-of-line% convention NIL NIL 38)(EOL% CONVENTION NIL Conventions NIL NIL 38 SUBTEXT end-of-line) for text. The EOL for binary files is carriage return (CR)(CARRIAGE% RETURN NIL Carriage% return NIL NIL 38). EOL uses the TYPE property of files. (The TYPE property of a file depends on the file extension and the DEFAULTFILETYPE and DEFAULTFILETYPELIST variables). If the TYPE property of a file is TEXT, LF (=10) is used as EOL. If the TYPE property of a file is BINARY, CR (=13) is used as EOL.
NOTE: EOL conventions on {DSK} are not compatible with those on Xerox workstations.
AUTHOR(AUTHOR (File Attribute) NIL NIL NIL 38) [File Attribute]
Returns the author of the file, i.e., the login name of the user who created it. This attribute cannot be changed.
PROTECTION(PROTECTION (File Attribute) NIL NIL NIL 38) [File Attribute]
Returns file protection attributes. The file protection attributes of files under the SunOS cannot be directly manipulated from inside Lisp. It is necessary to use the UNIX chmod(CHMOD (UNIX Command) chmod NIL NIL 38) command to change file protection bits(FILE% PROTECTION% BITS,% CHANGING NIL File% protection% bits,% changing NIL NIL 38 SUBTEXT changing).
SIZE(SIZE (File Attribute) NIL NIL NIL 38) [File Attribute]
Returns the file size. For compatibility with other Lisp environments running on Xerox workstations, the SIZE attribute is computed as the length of the file (in bytes) divided by 512 (rounded up).
NOTE: SETFILEINFO lets you change the SIZE attribute of I/O streams and output streams. However, a file cannot be expanded this way.
File Variables
1
This section discusses how certain file variables(FILE% VARIABLES NIL File% variables NIL NIL 39) are used by Medley in SunOS.
IL:FileTypeConfirmFlg [Variable]
The file<6C><65><00>$<24>type attribute of a file on {DSK} or {UNIX} is decided from its extension, DEFAULTFILETYPELIST and DEFAULTFILETYPE. Extensions of binary files should be registered in DEFAULTFILETYPELIST. When this rule is broken, a hardcopy of files on {DSK} and {UNIX} may confuse the printers. So when you try to hardcopy a file whose extension is not registered in DEFAULTFILETYPELIST, a menu is invoked to confirm the file type. Text or binary can be selected. The invocation of this menu can be stopped by setting IL:FileTypeConfirmFlg to NIL. The default value of IL:FileTypeConfirmFlg is T.
When extensions of binary files are not registered in DEFAULTFILETYPELIST, copy or rename from a DSK/UNIX device to a non<6F><6E><00>$DSK/UNIX device also may cause file type confusion. This type of copy <20> or rename <20><>results in <20>one of the following<6E><67> warning message<>s<><73> in the prompt window<>, as appropriate<74><65>:
<EFBFBD>Extension of {DSK}foo.fee;1 isn't in DEFAULTFILETYPELIST. {CORE}foo.fee;1 was copied as TEXT.
This message can be stopped by set FileTypeConfirmFlg to NIL.
Extension of {DSK}foo.fee;1 isn't in DEFAULTFILETYPELIST. {CORE}foo.fee;1 was renamed as TEXT.
This message can be stopped by set FileTypeConfirmFlg to NIL.
Either of these messages can be stopped by setting IL:FileTypeConfirmFlg to NIL.
IL:DEFAULTFILETYPE(DEFAULTFILETYPE (Variable) DEFAULTFILETYPE NIL NIL 39) [Variable]
Initially set to TEXT. Used with the file attribute TYPE(TYPE (File Attribute) NIL NIL NIL 39).
DEFAULTFILETYPELIST(DEFAULTFILETYPELIST (Variable) NIL NIL NIL 39) [Variable]
A list of accepted file types(FILE% TYPES NIL File% types NIL NIL 39). Initially set to ((NIL . TEXT)(C . TEXT)(H . TEXT)
(LISP . TEXT)(LSP . TEXT)(O . BINARY)(OUT . BINARY)(LCOM . BINARY)
(DFASL . BINARY)(DCOM . BINARY)(SKETCH . BINARY)
(TEDIT . BINARY)(DISPLAYFONT . BINARY)(WD . BINARY)(IP . BINARY)
(RST . BINARY)(BIN . BINARY)(MAIL . BINARY)(SYSOUT . BINARY))
Used with the file attribute TYPE. Binary files, such as Sketch files(SKETCH% FILES NIL Sketch% files NIL NIL 39)(SKETCH% FILES NIL Files NIL NIL 39 SUBTEXT Sketch), InterPress files(INTERPRESS% FILES NIL InterPress% files NIL NIL 39)(INTERPRESS% FILES NIL Files NIL NIL 39 SUBTEXT InterPress), or Press files(PRESS% FILES NIL Press% files NIL NIL 39)(PRESS% FILES NIL Files NIL NIL 39 SUBTEXT Press), should have their extensions registered in DEFAULTFILETYPELIST. This is especially important because UNIX does not support file types.
File System Errors
1
Several types of errors(ERRORS NIL Errors NIL NIL 39 SUBTEXT file% system) may occur in the Medley file system(FILE% SYSTEM NIL File% system% errors NIL NIL 39).
When a remotely mounted file system or NFS service(NFS% SERVICE NIL NFS% service NIL NIL 40) is down, or when network traffic is heavy, any attempt to access a file on that file system results in an error. The following error message is printed in the prompt window:
File access timed out
Medley will wait until the file system responds or until a timeout occurs. If the file system is mounted with the "hard" option, the timeout is controlled by the value of environment variable LDEFILETIMEOUT. If the file system is mounted with the "soft" option, the timeout depends on the NFS file system timeout time, and the value of LDEFILETIMEOUT. Medley will wait until the shorter of these two times is exceeded. The NFS file system timeout time, retry times, etc., are controlled by the UNIX command mount.
If LDEFILETIMEOUT is not set, the default value of 10 seconds is used. The variable is inspected at boot time, and a setting between 1 and 100 seconds is appropriate in most cases.
The following error messages may appear when there are Medley file errors:
Not owner
Device error:
Protection-violation
File-won't-open
Too-Many-Files-Open
File too large
File-System-Resources-Exceeded
Connectiom timed out
No-Such-Directory
Bad Host Name
FS-RENAMEFILE-SOURCE-COULDNT-DELETE
Another type of error occurs when the user has insufficient access to files. When this happens, Medley will print the following message:
File not found
The following message then appears in the SunOS prompt window:
System call error: open errno=13 Permission denied
See the UNIX Interface Reference Manual, Intro (2), for descriptions of all OS system call messages.
[This page intentionally left blank]
(LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "") STARTINGPAGE# 31) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (TEXT NIL NIL (54 54 504 690) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (54 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGV) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE VERSOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY HELVETICA OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (270 15 288 36) NIL) (HEADING NIL (HEADINGTYPE FOOTINGR) (54 27 558 36) NIL) (HEADING NIL (HEADINGTYPE RECTOHEAD) (54 762 558 36) NIL) (TEXT NIL NIL (54 54 504 684) NIL)))));6HT<01>
T<01>T8<00><01>
x<00><01>8<00><01>x<00><01>8<00><01>x<00><01>2ll<01>
<01>3HH<01><01>T2$$<01><00>5HT<01>T<01>2``<01><00>3HH<01><01>T2ll<01><01>2ll<01><01>5Hx<01>x<01>2HH<01>
x2Hx<01>x3HH<01> <01>T5HH<01>l<01>5ll<01>l<01>5HH<01>l<01>3HH<01> <01>T2HH<01>
l2$$<01>l2HH<01>l2HH<01>
<00>2HH<01><00>2<00><00><01><00>2<00><00><01><01>2ll<01><00>2ll<01><00>2HH<01><00>2HH<01>
<00>2$$<01><00>2HH<01><00>5HH<01>
l<01>2HH<01><01>2$$<01><01>5HH<01>`<01>5HH<01>
T<01>5HT<01>
T<01>2``<01><00>5Hl<01>l<01>5HH<01>x<01>3$$<01><01>T8Hl<01>l<00><01>8HH<01>l<00><01>2HH<01><01>2HH<01>
<01>-<01>T8<00><01><00><00><01>,HH<01>2<01><01>8<01>$<00><01>><00><00><01><00><00>h<01><01>-<01><00><01>T3HH<01><01>TF<01><01> PAGEHEADING VERSOHEADF<01><01> PAGEHEADING RECTOHEADE<01><01> PAGEHEADINGFOOTINGVE<01><01> PAGEHEADINGFOOTINGR! HELVETICA
 HELVETICA
 HELVETICA  HELVETICA HELVETICATITAN
<02>CLASSIC
<01>CLASSIC
<02>CLASSIC
CLASSIC
CLASSIC CLASSICCLASSIC
CLASSICTITAN
OPTIMA
OPTIMA
TITAN
?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8))
MODERN
TITAN
OPTIMA
TITAN
OPTIMA
TITAN
MODERN
MODERNOPTIMA
<02>OPTIMA
OPTIMA TITAN
OPTIMA
MODERN
; HRULE.GETFNCLASSIC

;,
: HRULE.GETFNCLASSIC

:-9
9 HRULE.GETFNCLASSIC

88 HRULE.GETFNCLASSIC

43 HRULE.GETFNCLASSIC
2C
 1:IM.INDEX.GETFNCLASSIC ;IM.INDEX.GETFN0 HRULE.GETFNCLASSIC/
3IM.INDEX.GETFN
)IM.INDEX.GETFN*





K
*







.
i
IM.INDEX.GETFN
IM.INDEX.GETFN
=IM.INDEX.GETFNOPTIMA

IM.INDEX.GETFN

CIM.INDEX.GETFNA
IM.INDEX.GETFN
7IM.INDEX.GETFN
1IM.INDEX.GETFN2IM.INDEX.GETFN.
.~
)2
10 HRULE.GETFNCLASSICIM.INDEX.GETFN>

IM.INDEX.GETFN:

IM.INDEX.GETFN"

J


/9
10 HRULE.GETFNCLASSIC/
1IM.INDEX.GETFN<00>
.g
  <00>
.%
 IM.INDEX.GETFN 
  /
  q
  R
  ;
  
9IM.INDEX.GETFN

:IM.INDEX.GETFN#
 "IM.INDEX.GETFN 
  j
 <00>
-
,IM.INDEX.GETFN
,

?




+  KIM.INDEX.GETFNCLASSIC  '
)

4
}




A


(% 
(T
'

6IM.INDEX.GETFNTITAN

C
8IM.INDEX.GETFN0IM.INDEX.GETFNK
'
6IM.INDEX.GETFNTITAN


<00>
'

C

T
(% 
('




IM.INDEX.GETFN
9IM.INDEX.GETFN


?
IM.INDEX.GETFN
IM.INDEX.GETFNCLASSIC
}


M
1IM.INDEX.GETFN
-IM.INDEX.GETFN
IM.INDEX.GETFNCLASSIC
.
4IM.INDEX.GETFN
-IM.INDEX.GETFN
IM.INDEX.GETFNCLASSIC
7
3IM.INDEX.GETFN
')


<00>


p

=
$6IM.INDEX.GETFNFIM.INDEX.GETFNCLASSIC
&
  f
'
)

p
4IM.INDEX.GETFN


:IM.INDEX.GETFN5IM.INDEX.GETFN
IM.INDEX.GETFNF




%

8IM.INDEX.GETFN
<00>


.
 '4
'Q

%
B


8
%

%

T
%3



M

#
#=IM.INDEX.GETFN HELVETICA
 /E
l
:
'
f
(% 
('
<00>
 #
'O
(% 
(@'
<00>

( 



'
0IM.INDEX.GETFN6

'
;

7

%
 ( 





 

'
<00>
( 

 
'


(  


'
<00>

( 

 
  
 



2
( 


 
 
 
'
'






!
0
( 

 5
 /
"IM.INDEX.GETFN
  
4IM.INDEX.GETFN%
  <00>
 .
$IM.INDEX.GETFN
]





E
f


.
 -
(IM.INDEX.GETFN
IM.INDEX.GETFNCLASSIC
2


 $7IM.INDEX.GETFN=IM.INDEX.GETFNCLASSIC

"
  _
:IM.INDEX.GETFN
IM.INDEX.GETFNC
 !IM.INDEX.GETFN R
.

 
.
*
9IM.INDEX.GETFN:
.b

 ($  &    " !
u
  /
"

8IM.INDEX.GETFN/
"IM.INDEX.GETFN
IM.INDEX.GETFN

IM.INDEX.GETFNOPTIMA

IM.INDEX.GETFN
!!3

m
!
d
 
  !
-
"!
@
#7IM.INDEX.GETFNIM.INDEX.GETFN
 9
  <00>
=
IM.INDEX.GETFN
 !IM.INDEX.GETFN 
 IM.INDEX.GETFN
|
7IM.INDEX.GETFN


;IM.INDEX.GETFNG
'IM.INDEX.GETFN !
  
 ^
)IM.INDEX.GETFNK

<00>


-
1IM.INDEX.GETFN
(IM.INDEX.GETFN
IM.INDEX.GETFN
 P
EIM.INDEX.GETFN
  a
-IM.INDEX.GETFN
IM.INDEX.GETFN
-IM.INDEX.GETFN
IM.INDEX.GETFN'

!IM.INDEX.GETFNOPTIMA
<02>
"V


.

E

!



<00>




G


#
4
 10 HRULE.GETFNCLASSIC/6
2IM.INDEX.GETFNO
:IM.INDEX.GETFN
.  
  
 +IM.INDEX.GETFNOPTIMA
<02>
.IM.INDEX.GETFNOPTIMA
<02>
/<00>
 
  *
&IM.INDEX.GETFN $IM.INDEX.GETFN 'IM.INDEX.GETFN
IM.INDEX.GETFN
IM.INDEX.GETFN
&IM.INDEX.GETFNOPTIMA
<02>/
 
)IM.INDEX.GETFN+IM.INDEX.GETFN
 
+
)IM.INDEX.GETFN 
 ,IM.INDEX.GETFN_
+IM.INDEX.GETFN 
 /IM.INDEX.GETFN U
 
 

%IM.INDEX.GETFNOPTIMA
<02>/




IM.INDEX.GETFN
 IM.INDEX.GETFN
&IM.INDEX.GETFNOPTIMA
 

8IM.INDEX.GETFN@IM.INDEX.GETFN
 #
2IM.INDEX.GETFN 
U










3
(IM.INDEX.GETFNOPTIMA
<02>
t

,IM.INDEX.GETFNOPTIMA
<02><00>
'IM.INDEX.GETFN(
eIM.INDEX.GETFN
&IM.INDEX.GETFN/i
 Z



\
 10 HRULE.GETFNCLASSIC/1
0IM.INDEX.GETFN
  /





3
0

c
<00>



.6
.
<00>


#

-


 a >` >.3

7IM.INDEX.GETFNOPTIMA
<02>  /
!
!&IM.INDEX.GETFN!/IM.INDEX.GETFNOPTIMA
<02>  /
(IM.INDEX.GETFN






































!.
!"
,IM.INDEX.GETFN3IM.INDEX.GETFN
4IM.INDEX.GETFN;IM.INDEX.GETFN
*IM.INDEX.GETFN1IM.INDEX.GETFN-
F
 10 HRULE.GETFNCLASSIC/
3IM.INDEX.GETFN$
2IM.INDEX.GETFN
.2
*IM.INDEX.GETFN<00>
.<00>
<00>
<00>
.
<00>
.L

        
 $.<00>
.@
6

>
6%
7!7l~Lz<4C>