          <<< NOTED::DISK$NOTES7:[NOTES$LIBRARY_7OF4]HACKERS.NOTE;1 >>>
                               -< ** Hackers ** >-
================================================================================
Note 1533.55          Announcing DFU Disk and File Utility              55 of 76
GALINA::SSMITH "Picard & Riker in '96"               59 lines  17-AUG-1995 01:14
                              -< LEAVE_STUB.COM >-
--------------------------------------------------------------------------------
$! LEAVE_STUB.COM
$!
$!	@LEAVE_STUB spec(s) [ERASE][,LISTING]
$!
$! Replace selected files with empty files of the same spec.  The empty file has
$! identical time-stamps as the original file. 
$! If ERASE is set, /ERASE files as they are DELETEd.
$! If LISTING is set, spec is a list of files to be deleted.  After the files in
$! the list are deleted, the listing file itself is deleted.
$!
$ IVVERB == %X00038090
$ CLOSE = "CLOSE"
$ COPY = "COPY"
$ DELETE = "DELETE"
$ DIRECTORY = "DIRECTORY"
$ GOTO = "GOTO"
$ IF = "IF"
$ OPEN = "OPEN"
$!
$! 1A. Define ERASE symbol appropriately, depending if ERASE was specified.
$	ERASE = ""
$	if f$locate( "ERASE", p2) .ne. f$length( p2) then ERASE = "/erase"
$! 1B. Define LISTING symbol appropriately, depending if LISTING was specified.
$	LISTING = "false"
$	if f$locate( "LISTING", p2) .ne. f$length( p2) then LISTING = "true"
$!
$! 2. If a list file was NOT given, make up a list file name, then make a list
$!    file.
$	if LISTING then LIST_FILE = p1
$	if .not. LISTING then -
	LIST_FILE = "SYS$SCRATCH:LISTING.SXX_" -
		+ ("XXX"+f$getjpi("","pid")-"X0000"-"X00"-"X0"-"XX"-"X")
$	if f$locate( ";", LIST_FILE) .eq. f$length( LIST_FILE) then -
	LIST_FILE = LIST_FILE + ";"
$	if .not. LISTING then -
	directory 'P1'/noheading/notrailing/output='LIST_FILE'
$!
$! 3. Open the list file and read each file.  Get time-stamps of each file.
$	open /read LIST_ 'LIST_FILE' 
$L1:	read /end=L9 LIST_ FILE
$	FILE = f$element( 0, " ", -
			  f$edit( FILE, "trim,compress,upcase,uncomment"))
$	  if FILE .eqs. "" then goto L1
$	CDT = f$file_attribute( FILE, "CDT") ! Created
$	RDT = f$file_attribute( FILE, "RDT") ! Revised
$	BDT = f$file_attribute( FILE, "BDT") ! Backed-up
$	EDT = f$file_attribute( FILE, "EDT") ! Expires
$!
$! 4. Delete existing file and replace with empty file.  Then set the time-
$!    stamps. 
$	delete 'FILE' 'ERASE' /log
$	copy NLA0: 'FILE'
$	DFU SET 'FILE' /creation_date="''CDT'" /revision_date="''RDT'" -
		/backup_date="''BDT'" /expiration_date="''EDT'" /log
$	goto L1
$!
$! 5. Clean up.  Delete listing file.
$L9:	Close LIST_
$	Delete 'LIST_FILE'
