F.G.H. 4/2/85 LispCourse #18: Files and Directories œ Part 4 LispCourse #18: Files and Directories œ Part 4 Methods for Dealing with Files Outside of Interlisp Interlisp provides a nearly uniform interface for dealing with files on a wide variety of devices. Because it attempts to be uniform, it does not take full advantage of the full capabilities of each device. Many devices allow you to log into the device directly and interact with a specialized Exec for that device. These device Execs give you access to the full power of each device. However, each such Exec is different, depending on the software running on that device. There is NO access to the following devices outside of Interlisp: DLion Local Disk Floppies Core Devices There is are non-Interlisp Execs on the following devices: IFS file servers (the IFS Exec) NS file servers Vax-Unix file servers Dolphin/Dorado Local Disk (the Alto Exec) For devices that run as file servers, you can login from within Interlisp by using the CHAT program. For the Dolphin/Dorado Local Disk, you must log out of Lisp and use the Alto Exec. CHATing to an IFS CHAT is a package in Interlisp that allows you to open a window that is a virtual terminal to any other device on the network (that supports virtual terminals). This window acts exactly like a standard character-type computer terminal of the type you never see around PARC. From this virtual terminal you can log onto the device and enter commands into its Exec directly without going through Interlisp. Files stored on an IFS can be manipulated by using CHAT to log into the IFS and then using the file manipulation commands of the IFS executive. Opening a CHAT window To log into an IFS, use the CHAT package. To start CHAT, type (CHAT Host) into the Lisp Exec window. Host is the name of the IFS you want to login to. If Host is not specified, then you will be prompted for a name in the Exec window. Alternatively, you can choose the CHAT entry from the BackgroundMenu. You will then be given a menu with a list of IFS (and other non-IFS) servers. Choose the appropriate name or Other, which will prompt you for a Host server (i.e., an IFS server in this case) name in the Prompt window. CHAT will reuse the most recent CHAT window, if it is available. Otherwise, it will prompt you for a region and open a new Chat window in that region. Once the window opens, you are "chatting" to the IFS executive in the Chat window. Everything you type in is just forwarded to the IFS and is NOT intepreted by Lisp. CHAT will automatically log you on to the IFS. If you want to prevent CHAT from logging in (e.g., if yopu want to log in under someone else's name), start CHAT using (CHAT Host 'NONE) in the Lisp Exec window. The IFS executive The IFS executive has an @ prompt. All commands must be terminated by . Some commands have sub-commands. When the IFS is in sub-command mode (i.e., is expecting a sub-command), then the prompt will be a @@. In sub-command mode, a will exit the sub-command mode and execute the current command. When typing into the IFS exec: BS œ erases the preceding character CTRL-W œ deletes a word DEL œ deletes an entire command or sub-command. CTRL-C may be used to abort any command. Typeout will stop whenever the window fills up with text and IFS will wait for you to type any character before continuing. If you type ahead, this feature is disabled. When typing a command to the IFS exec, you need only type enough of each command to make it uniquely identifiable. For example, the Directory command can be specified by typing Di, but not by typing just D because D is not sufficient to distinguish between the Directory and Delete commands. The available commands are: Login (user) user-name (password) password œ Logs you into IFS. This is necessary before issuing most other commands. Ordinarly, Chat will do this for you automatically. Logout or Quit œ Logs you out and closes the CHAT window. Connect (to directory) directory-name (password) password œ Sets your default directory to be directory-name, and gives you owner-like access to it. The password may be omitted if directory-name is your own directory or one to which you have connect privileges. Directory (default) directory-name œ Sets your connected directory to be directory-name, but without changing your access rights (and therefore without requiring a password). Connected directories behave as in Interlisp (see LispCourse #16, p. 1). List (files) file-designators œ Lists the names of all files matching file-designators, which is a list of up to 10 file names (separated by spaces), any of which may contain *'s to denote multiple files. The files matching each file-designator are listed in alphabetical order. If you terminate the last file-designator with a comma followed by (rather than just ), IFS enters a sub-command mode (with the @@ prompt) in which you may specify additional information to be printed about each file: Type file type and byte size Size size in pages Length length in bytes Creation date of file creation Write date of last write Read date of last read Backup date of last backup Times times as well as dates Author creator of file Protection file protection Verbose same as Type Size Write Read Author Everything Sub-command mode is terminated when you type just RETURN in response to the @@' prompt.. Delete file-designator œ Deletes all files matching file-designators, which is a list of up to 10 file names (separated by spaces), any of which may contain *'s to denote multiple files. The version number defaults to the lowest existing version; to delete all versions, you must end each file-designator with !*'. IFS prints out each file name, followed by [Confirm]'. You should respond with Y' or to delete the file, or with N' or to leave it alone. If you terminate the last file-designator with a comma followed by , IFS enters a sub-command mode (@@ prompt) in which you may request the following additional actions: Confirm (all deletes automatically) œ IFS will not ask you to confirm deleting each file but will just go ahead and do it. Keep (# of versions) number œ IFS will retain the number most recent versions of each file and delete all remaining versions. That is, to delete all but the most recent version of each file, specify Keep 1'. Rename existing-filename (to be) new-filename œ Changes the name of existing-filename to be new-filename. If you terminate new-filename with ESC rather than RETURN, the body of old-filename (with directory and version stripped off) will be appended to new-filename. Print (files) file-designator or Press (files) file-designator œ Requests that all Press files matching file-designator be sent to your default printing server (Print' and Press' are synonyms). IFS prints out the name of each file followed by [Confirm]'; you should respond with Y' or to print the file, or with N' or to skip over it. If you terminate the last file-designator with a comma followed by , IFS enters a sub-command mode (@@ prompt) in which you may specify the following parameters: Copies number œ Specifies the number of copies of each Press document to print. Server server-name œ Specifies the name of the printing server to which the Press files are to be transmitted. This may be either a registered name or an internetwork address of the form net#host#' (don't leave off the trailing #'). In the absence of any sub-commands, IFS will cause one copy of each Press file to be printed on your default printing server. Printing request may be examined and canceled with the commands Show Printing-requests and Cancel (printing requests), respectively. Note that only Press-format files can be printed; IFS checks that every file is a Press file and will refuse to print any file that is not. DskStat œ Prints the number of used pages and the maximum allowed in the connected directory, followed by the number of free pages in the system. One IFS page is 1024 words or 2048 characters, which is equivalent to four Alto pages. Systat œ Shows who is presently using IFS, what service they are accessing (FTP, Telnet, CopyDisk, or Mail), and the name or inter-network address of the machine they are coming from. Commands dealing with protections The Chat Executive contains several commands by means of which you may manipulate protections of files and directories. Change Protection (of files) file-designators œ See LispCourse #15, p.14) Change Directory-Parameters (of directory) directory-name œ Changes the information associated with the directory as a whole in the manner specified by the sub-commands. Sub-command mode is entered autromatically. The directory must be either your own or one to which you are connected. You may change the default file protection by means of the Read, Write, and Append sub-commands in the same manner as in the Change Protection command. Additionally, you may change the create and connect access using the sub-commands: Create (access permitted to) groups Connect (access permitted to) groups The No' prefix may be applied to these as well as to the others. You may change your default printing server by means of the sub-command: Printing-Server host-name Show Directory-Parameters (of directory) directory-name œ Displays all information about directory-name, and additionally prints some other parameters, such as the disk limit and the owner of a files-only directory, that may be changed only by an IFS administrator. The Interlisp CHAT program While CHATing to an IFS (or any other kind of host) you can communicate with the Interlisp CHAT program by clicking the MIDDLE mouse button in the CHAT window. This will bring up a menu with the following options: Close œ Close this connection. Once the connection is closed, control is handed over to the main tty window. Closes the window. Suspend œ Same as Close, but always leaves the window open. New œ Closes the current connection and prompts for a new host to which to open a connection in the same window. Freeze œ Hold typeout from this Chat window. Bugging the window in any way releases the hold. This is most useful if you want to switch to another, overlapping window and there is typeout in this window that would compete for screen space. Dribble œ Open a typescript file for this Chat connection (closing any previous dribble file for the window). The user is prompted for a file name; a name of NIL just closes the old dribble file. Input œ Prompts for a file to take input from. When the end of the file is reached, input reverts to T. Clear œ Clears the window and resets the simulated terminal to its default state. This is useful if undesired terminal commands have been received from the remote host that place the simulated terminal into a funny state. The mouse button LEFT, when inside a CHAT window, holds output as long as the button is down. The following variable control CHATs behavior: CLOSECHATWINDOWFLG œ If non-NIL, every Chat window is closed on exit. If NIL, the initial setting, then the primary Chat window is not closed. Default value is ????. CHAT.FONT œ If non-NIL, the font that Chat windows are created with. If CHAT.FONT is NIL, Chat windows are created with (DEFAULTFONT 'DISPLAY) [To be covered in a later class!]. Default value is ????. DEFAULTCHATHOST œ The host to which CHAT connects when it is called with no HOST argument. Default value is ????. CHAT.ALLHOSTS œ A list of host names, as uppercase litatoms, that the user desires to Chat to. Chatting to a host not on the list adds it to the list. These names are placed in the menu that the background Chat command prompts with. Default value is ????. CHAT.DISPLAYTYPE œ The type of display (a number) that Chat should tell the remote host the user is on. If Datamedia emulation is desired, this variable should be set to the number corresponding to the terminal type Datamedia for the remote host. If the remote host does not respond to the terminal type protocol in Pup Telnet, this variable is irrelevant. Default value is 10. CHAT is documented in Section 20.5 of the IRM. CHATing to an NS File Server You can use CHAT to access an NS file server as well. The CHAT package works the same way as in CHATing to an IFS. However, the Exec running on the NS server is very different from the IFS Exec. See ??? for documentation on the NS Exec. CHATing to an Vax-Unix File Server You can use CHAT to access a Vax-Unix file server. The CHAT package works the same way as in CHATing to an IFS. When CHATing to a Vax-Unix file server, you are interacting with a full-scale computer system equal in complexity to Interlisp. The Unix shell (the Unix term for an Exec) supports much more extensive repetoire of file manipulation capabilities than does Interlisp. Unfortunately, the philosophies are somewhat different, so that it is sometimes hard to manipulate Interlisp files using Unix programs . See any of a number of Unix books on the market or the Unix programmer's manual for more information on using Unix. The Alto Exec on Dolphin/Dorado Local Disk When you boot a Dolphin or Dorado set up for Lisp, you enter into an Exec called the Alto Exec. From this Exec, you type "Lisp" to get inot Lisp. When you LOGOUT from Lisp, you are returned to the Alto Exec. The Alto Exec has a few file manipulation capabilities that you can use to manipulate file on your local disk. Commands include DELETE, RENAME, FILESTAT. There are also separate Alto programs that run under the Alto Exec called Neptune (like the FileBrowser) and FTP (analogous COPYFILE) that can be used to manipulate files. See the Alto Users Guide for documentation on the Alto Exec, Neptune and FTP. (LIST ((PAGE NIL NIL (0 0 17 22) ((HEADING NIL (HEADINGTYPE YYY) (540 756 72 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL))) (PAGE NIL NIL (0 0 17 22) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 SIZE 12 FAMILY TIMESROMAN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (468 756 72 36) NIL) (HEADING NIL (HEADINGTYPE XXX) (72 756 72 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL))) (PAGE NIL NIL (0 0 17 22) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (SUPERSCRIPT 0 SIZE 12 FAMILY TIMESROMAN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF SLOPE REGULAR WEIGHT MEDIUM)) (468 756 72 36) NIL) (HEADING NIL (HEADINGTYPE XXX) (72 756 72 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL)))))4$$zz $(0 300 0 223 6 404 5 333 1 127)ĆĆ $(0 300 0 223 6 404 5 333 1 127)ŸŸ $(0 300 0 223 6 404 5 333 1 127)ŸŸ $(0 300 0 223 6 404 5 333 1 127)ĆĆ $(0 300 0 223 6 404 5 333 1 127)ŸŸ $(0 300 0 223 6 404 5 333 1 127)zz $(0 300 0 223 6 404 5 333 1 127)zz $(0 300 0 223 6 404 5 333 1 127)UU$(0 300 0 223 6 404 5 333 1 127)zz $(0 300 0 223 6 404 5 333 1 127)zz $(0 223 6 404 5 333 1 127)ŸŸ$(0 300 0 223 6 404 5 333 1 127)ŸŸ$(0 300 0 223 6 404 5 333 1 127)ŸŸ$(0 300 0 223 6 404 5 333 1 127)ĆĆ$(0 300 0 223 6 404 5 333 1 127)ĆĆ$(0 300 0 223 6 404 5 333 1 127)ŸŸ$(0 300 0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)zz $(0 300 0 223 6 404 5 333 1 127)ĆĆ $(0 300 0 223 6 404 5 333 1 127)ĆĆ $(0 300 0 223 6 404 5 333 1 127)ŸŸ $(0 300 0 223 6 404 5 333 1 127)zz$(0 300 0 223 6 404 5 333 1 127)ŸŸ $(0 300 0 223 6 404 5 333 1 127)ĆĆ$(0 300 0 223 6 404 5 333 1 127)ŸŸ$(0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)zz$(0 223 6 404 5 333 1 127)ll$(0 223 6 404 5 333 1 127)HH $(0 223 6 404 5 333 1 127)H„ H„HHlllØ lØHHHH$$ HH HH HH$$ˆ PAGEHEADINGXXXH PAGEHEADINGYYY TIMESROMAN TIMESROMAN TIMESROMAN TIMESROMAN  TIMESROMAN  TIMESROMAN TIMESROMAN  TIMESROMAN  TIMESROMAN  TIMESROMAN TIMESROMAN 4 30 20 14 0Ņ 0 0B * * * 0; + + + +* 0¹ 1 0– 0 0/?   1  K -"    h .˜ .§ .0 w ,/  -   /„    A # "" " "- "$ #Ŗ /… $     .   / !        )   "  .    D &  ¢  )  ‘  #       …            %   Z    ß  P             g $ U    š           ?   *  N V             _ C  Ŗ    ' € @      ~   ą  ±  ! x   + `    y ģ B I  )   £ ,/× '} '6 'o 'ģ 'æ 'd 'Ū &^ %/ )¢   ) !   )m   )ż   (} $/ 1 Ē*1# q”u1+  ¾ ßj   6  6Īz¹