XEROX CCACHE 2 4 1 CCACHE 1 4 By: Henry Thompson (HThompson.pa@Xerox) INTRODUCTION The file CCACHE implements a cheap caching facility to improve life in a world where the local disk supports random access, but is not backed up or accessible to others, while the file server is backed up and accessible to others, but does not support random access. It works by advising various parts of the i/o system and file package, so that track is kept of all files written to the local disk, and provision make for saving them back to the file server. The interface is via MAKEFILE/CLEANUP, and thus falls into the paradigm of dump/compile/list. The principal motivation for wanting to make it easy and safe to keep files on the local disk is the range of Interlisp facilities which only work on random access files. These include incremental remaking and recompilation (a big time saver with large packages), selective loading of parts of files, production of indexed listings and straight-forward random accessing of datafiles, e.g. speech data. Saving local files The first way the facility manifests itself is via the output of FILES?, which will now include the names of files which need saving, as well as dumping, compiling and/or listing. A file is noted as needing to be saved whenever it is written to an 'unsafe' host (e.g. the local disk - see below). A file can be saved by including the keyword SAVE in the options to MAKEFILE or CLEANUP, either directly (e.g. CLEANUP((RC ST SAVE) FILE1 FILE2) to dump, recompile and save FILE1 and FILE2) or indirectly via CLEANUPOPTIONS (q.v.), or by calling the function SaveFiles, which is analogous to LISTFILES or MAKEFILES - it either saves the files given as arguments (e.g. SaveFiles(FILE1 FILE2) ) or if given no arguments saves all files needing to be saved. What saving means is copying to a 'safe' host. The facility tries hard to know what the right place to save a particular file is. It does this by means of a new property which it keeps on file names called FILEHOME. If you have copied the file from a safe host via CacheFiles (see below), then it will set FILEHOME to the place they came from. If you LOADed the file from a safe host, and then MAKEFILEd it to an unsafe one, it will set FILEHOME to the original location, which is stored by LOAD on the FILEDATES property. If the extension of the file identifies it as a 'fellow traveller' (see below), and its un-suffixed name has a FILEHOME, that is used for it as well. If none of these strategies work, you will be prompted for the name of a host and directory, with your directory on a likely file server as default. If you control-E out of this prompt, the file will not be saved, nor will you be asked again about it. This is effected by setting its FILEHOME property to NONE, something you can do directly to prevent a file from participating in the whole business. When a file with no extension is saved, those of its fellow travellers which also need to be saved are also saved. Files which the file system believes need to be dumped will not show up as needing to be saved, even if they have been written and not saved. This is by analogy to the way NOTLISTEDFILES and NOTCOMPILEDFILES are handled, but can be overridden - see below. Caching files To cache files e.g. on the local disk, a clean interface is provided via the function CacheFiles. Rather like FILESLOAD, it is a nospread NLAMBDA which takes a mixture of file names and parameterisations which allow you to specify the source and destination directories. To specify the destination directory, give an argument which is a two element list whose first element is the keyword TO and whose second is the directory. Similarly use FROM to specify source directories. Destination defaults to the currently connected directory, and source to {safest}, where safest is the first entry on CCacheSafeHomes (see below). Thus for example if user ROBIN were connected to {DSK}ROBIN> and did CacheFiles((FROM {SERVER1}) FILE1 (TO ROBIN>SUB1>) FILE2) then {SERVER1}FILE1 would be copied to {DSK}ROBIN>FILE1 and {SERVER1}FILE2 would be copied to {DSK}ROBIN>SUB1>FILE2. III. Switches and parameters CCacheSafeHomes - a list of hosts (typically file servers) which are officially 'safe'. Should be initialised in site INIT files. Note - should NOT include curly braces {}. CCacheUnsafeHomes - a list of hosts which are officially 'unsafe'. Initially DSK. Note - should NOT include curly braces {}. CCacheFellowTravellers - a list of extensions which should be saved with their unsuffixed 'parent'. Initially includes DCOM and DATABASE. Also participates in determining who needs saved - if FOO needs saved but also needs dumped, then not only will FOO not show as needing saved, but neither will any of its fellow travellers. CCacheSaveAll - if non-NIL then overrides the convention that files needing to be dumped are not shown as needing to be saved, even if they have been written out and thus are not up to date. Initially NIL. CCachePrintMoves - if non-NIL then every copy provoked by a caching or saving operation will be logged to the tty displaystream. Initially T. NotSavedFiles - the database of files needing to be saved. (LIST ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC ) STARTINGPAGE# 1) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC )) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC )) (174 36 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (84 744 528 36) NIL) (TEXT NIL NIL (84 96 456 600) NIL)))))(Č(ŠŠ8(ŠŠ8DČČ PAGEHEADING RUNNINGHEAD(Č ( MODERN MODERN MODERN MODERNLOGOMODERN MODERN MODERN MODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN  HRULE.GETFNMODERN )    “*-•:s‡3k ?¯JĪ;šQzē