[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new DIR features



a couple of weeks (months?) ago, I installed a new version of the DIRECTORY
package, with a couple of things cleaned up. This version has been stable long
enough that I am now documenting the new features.

The following is a complete list of the 'commands' recognized by the DIRECTORY
processor (some of these are old, and some are new):

commands which print something:

P	prints file name
PP	prints file name sans version (used by NDIR)

SIZE, READDATE, WRITEDATE, CREATIONDATE, LENGTH, BYTESIZE, 
PROTECTION, AUTHOR
	prints the appropriate information returned by GETFILEINFO.
	(the list fileinfotypes provides additional formatting information to
	the directory function).

"string"		print the given string


commands which affect the value returned:

COLLECT   	the value of DIRECTORY is a list of file names; add
		this file name to that list
COUNTSIZE	the value of DIRECTORY is a sum. Add the SIZE of
		this file to the sum.


interactive commands:

PAUSE	wait until the user types something before proceeding with
	the rest of the commands.

arbitrary expression or predicate:

@ expression	the expression following an @-sign is either a function
		of one argument (JFN), a function of two arguments
		(JFN FILENAME) or an arbitrary expression which uses
		JFN and/or FILENAME freely. (it is a minor efficiency hack
		that if FILENAME is not used in the expression, it isn't
		computed).

OLDERTHAN n	proceed if the file hasn't been referenced (read or 
		written) in n days; e.g. DIR *.* OLDERTHAN 90 P DELETE
		will delete all files not referenced in 90 days).

BY user	proceed if the file was last written by the given user.

OLDVERSIONS n	proceed if there are at least n more recent versions
		of the same file (note that this IS NOT IMPLEMENTED for
		TOPS20 and DIRECTORY will complain if you try to
		use it on a TOPS-20 system). For example, to delete all
		but the most recent version of a file,
		DIR FILE OLDVERSIONS 1 P DELETE

set internal directory state:

DELETED	allow DIRECTORY to examine deleted files (normally, they
		are not mapped over).
OUT filename	direct all output to given filename
COLUMNS n	attempt to format output in n columns (rather than
		just 1).

perform actions on the given file:

DELETE	delete the file (undoably!)
UNDELETE	un-delete the file (undoably!). This also does a 'DELETED'
		so that DIRECTORY only considers deleted files.


As before, DIRCOMMANDS is used as a spelling list and to supply defaults and
abbreviations. Valid shorthand commands are:

AU 		 AUTHOR
-  		 PAUSE
COLLECT?	PROMPT " ? " COLLECT
DA, TI		WRITEDATE
DEL		DELETE
DEL?, DELETE?	PROMPT " delete? " DELETE
OLD		OLDERTHAN 90
PR		PROTECTION
SI		SIZE



Also as part of the DIRECTORY package, the functions

/delfile[filename]	delete filename (undoably).
undelfile[filename]	undelete filename
/undelfile[filename]	undelete filename (undoably)

are provided. At type-in, delfile is converted to /delfile.

Larry