Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap4_198111 - decus/20-0119/squash.doc
There are 2 other files named squash.doc in the archive. Click here to see a list.
	...SQUASH.....

ABSTRACT:

MIKE FRY  U OF ILL, CU
  SQUASH IS A NONINTERACTIVE FORM OF 'UFLIP'.
  IF 'MASTER.LIB' IS NOT FOUND, ALL DISK FILES WITH THE FOLLOWING
EXCEPTIONS ARE COPIED INTO IT AND DELETED. THE EXCEPTIONS ARE:
	*.REL	*.BAK	*.TMP	*.SFD

  IF 'MASTER.LIB' IS FOUND, IT IS DECOMPOSED BACK INTO THE ORIGINAL
FILES WITH THE ORIGINAL ACCESS DATES, CREATION TIME-DATES, ETC.

  THE PURPOSE OF SQUASH IS TO DECREASE DISK USAGE AT LOGOUT.
END ABSTRACT.
	MORE DETAIL:
TO RUN SQUASH, SIMPLY 'LOAD' AND 'SAV' IT. (SQUASH.MAC IS THE
SOLE SOURCE FILE.) THE SWITCHES AGEREF,BKON, AND THE PSVBLK
SHOULD BE GIVEN THEIR APPROPRIATE VALUES BEFORE ASSEMBLY, AS SHOULD
PROJCT AND PROGCT. THESE ARE EXPLAINED BELOW.

SUPERCEDE:
  IF SQUASH IS DECOMPOSING A LIBRARY FILE AND IT FINDS THAT  SOME
FILE IN THE LIBRARY IS ALREADY OUT THERE ON DISK, IT WILL WARN THE
USER, SLEEP A SECOND OR TWO FOR ERROR RECOVERY, AND DELETE THE LIBRARY
VERSION. I.E., IT WILL NOT OVERWRITE ANY EXISTING FILES. IF THE SLEEPING
GETS IRRITATING, TYPING ANY CHARACTER WILL SIGNAL SQUASH NOT TO
SLEEP ON SUCCEDING FILENAME TYPOUTS.

SAFETY:
  SQUASH IS DESIGNED FOR THE NOVICE. IT HAS  NO SWITHCES, OPTIONS
COMMAND FORMATS, OR FLEXIBILITY. IF INTERRUPTED IN MID-STRIDE,
THERE IS NO DANGER OF LOSS OF DATA. IF A FILE IS MISSING, RUN SQUASH
AGAIN. THE MISSING FILE IS EMBEDDED IN A LIBRARY FILE, WHICH SQUASH
WILL DECOMPOSE. (AT THIS POINT THERE IS THE POSSIBILITY OF SUPERCEDE
IF IT COPIED A FILE INTO THE LIB FILE BUT WAS STOPPED BEFORE IT COULD
DELETE IT. THAT'S MERELY A MATTER OF A CONFUSING MESSAGE, THOUGH.)
NO FILE IS DELETED UNTIL IT IS SAFELY COPIED TO THE LIB FILE AND SAID
FILE IS CLOSED, AND THE LIB FILE IS NOT DELETED ON DECOMPOSITION UNTIL
ALL ITS FILES HAVE BEEN WRITTEN AND CLOSED. 
  WARNING: THE 'CLOSE' OR 'FINISH' COMMANDS AFTER INTERRUPTING SQUASH
MAY RESULT IN LOST DATA. (AT LEAST ON DECOMPOSITION.)

THE STRUGGLE FOR DISK ROOM:
  THOUGH SQUASH WAS WRITTEN WITH LOGGED OUT QUOTA IN MIND, LOGGED
IN QUOTA AND ABSOLUTE DISK SPACE PROBLEMS HAVE TO BE CONSIDERED.
SUPPOSE, FOR EXAMPLE, A NEW BASIC PROGRAMMER HAS LOGGED-IN QUOTA
OF 20 BLOCKS, LOGGED OUT QUOTA OF 100 BLOCKS, AND
SQUASH IS RUN WITH 17 SINGLE BLOCK BASIC FILES ON DISK. WHEN
SQUASH STARTS, 85 BLOCKS ARE BEING USED. SQUASH OPENS THE LIB FILE,
SKIPS OVER BLOCK 1 (RESERVED FOR THE DIRECTORY) AND BEGINS COPYING
THE BASIC FILES IN. HAVING COPIED 12 OF THEM, 100 BLOCKS ARE IN USE.
(2 RIB BLOCKS, THE DIRECTORY BLOCK, ETC.). ON ATTEMPTING THE 13TH
FILE, QUOTA IS EXCEEDED. A CRITICAL POINT HAS BEEN REACHED.
  THE MONITOR WILL ALLOW FURTHER COPYING INTO THE LIB FILE FOR QUITE
A WHILE, SO LONG AS NO NEW FILES ARE ENTERED. SUPPOSE THAT'S WHAT
SQUASH DID. ALL 17 BASIC FILES ARE NOW SAFELY TUCKED AWAY, THE DIRECTORY
BLOCK IS WRITTEN IN REL BLOCK 1, THE LIB FILE IS CLOSED AND PROTECTED,
AND THE 17 BASIC FILES ARE DELETED. THE LIB FILE ONLY TAKES 20 BLOCKS,
AND THE USER LOGS OUT FEELING QUTE SATISFIED. NEXT DAY, OUR
USER LOGS IN AND RUNS SQUASH, WHICH MERRILY GOES ABOUT WRITING BASIC
FILES. HAVING WRITTEN 16 OF THEM, 100 BLOCKS ARE AGAIN IN USE.
HOWEVER, THIS TIME  SQUASH MUST ATTEMPT AN ENTER, WHICH FAILS.
OUR USER'S FIRST 16 FILES ARE SAFE, BUT THE 17TH IS COMPLETELY
INACCESSABLE. DELETING SOME OF THE FIRST 16 FILES WILL DO NO GOOD,
FOR RUNNING SQUASH WILL ONLY RESULT IN THEIR BEING REWRITTEN BEFORE
CONSIDERATION OF THE 17TH.
  THE REAL SOLUTION TO THIS DILEMNA IS A BETTER OPTION FOR SQUASH
WHEN IT ACHIEVES LOGGED IN QUOTA WHILE WRITING THE LIB FILE. INSTEAD
OF MARCHING BLINDLY ON, SQUASH WILL IMMEDIATELY CLOSE THE LIB FILE,
DELETE THE 12 IT HAS COPIED IN, REOPEN THE LIB FILE, USETO TO THE
END OF THE FILE, SKIP A BLOCK FOR THE DIRECTORY, COPY THE
REMAINING 5 FILES, WRITE THE LATER DIRECTOREY, AND WRITE A POINTER
IN THE FIRST WORD OF BLOCK 1 TO THE SECOND DIRECTORY. THEN, OF COURSE,
CLOSE THE LIB FILE, DELETE THE REMAINING 5 BASIC FILES, AND EXIT.
UNFOTUNATELY, MASTER.LIB TAKES 25 INSTEAD OF 20 BLOCKS THIS TIME,
SO OUR USER MUST DELETE SOME FILES. ON RUNNING SQUASH AGAIN, THE
FIRST WORD OF BLOCK 1 IS CHECKED. BEING NONZERO, SQUASH DOES A
USETI TO THE SECOND DIRECTORY, DECOMPOSES AS USUAL FROM THERE, REWRITES
BLOCK 1 TO POINT TO THE NEXT EARLIER DIRECTORY BLOCK (ITSELF), THEN
DOES A LONG BLOCK RENAME OF THE LIB FILE, DEALOCATING THE TRAILING
BLOCKS STARTING WITH THE SECOND DIRECTORY. THE SECOND DIRECTORY'S
FIRST WORD POINTS TO THE REL BLOCK OF THE PREVIOUS DIRECTORY (I.E.,
THAT WITH NEXT LOWER REL BLOCK NUMBER) SO SQUASH DOES A USETI TO BLOCK
1, DECOMPOSES, DELETES MASTER.LIB, AND EXITS.  AT NO TIME ARE MORE THAN
100 BLOCKS IN USE. OUR USER DELETES 1 FILE, RUNS SQUASH, FINDS THAT
MASTER.LIB TAKES ONLY 20 BLOCKS (LOGGED IN QUOTA WAS NEVER EXCEEDED)
AND LOGS OUT.
  IN GENERAL, BLOCK 1 POINTS TO THE LAST DIRECTORY BLOCK (ACTUALLY,
IT HOLDS THE REL BLOCK OF THE DIRECTORY MINUS 1) AND EACH SUCCESSIVE
DIR BLOCK POINTS TO THE PRECEDING ONE. MASTER.LIB THUS SHRINKS AS
IT IS DECOMPOSED, AND NEVER ARE MORE BLOCKS BEING USED ON DECOMPOSITION
THAN ON CREATION.
  THIS IS ALSO HOW COMPETITION FOR DISK SPACE AND THE REMOTE POSSIBILITY
OF MORE THAN THE 31 POSSIBLE 4 WORD (LOOKUP BLOCK) ENTRIES IN
A DIRECTORY OF ONE BLOCK IN LENGTH ARE HANDLED.

	AGE CONDITION:
  ON SOME SYSTEMS IT MIGHT NOT BE DESIRABLE FOR FILES NOT ACCESSED
FOR A LONG TIME TO BE HIDDEN AWAY AFTER EVERY LOGOUT. SO AS AN ASSEMBLY
OPTION SQUASH CAN BE MADE TO IGNORE FILES WITH SMALL ACCESS DATES.
THE CONSTANT 'AGEREF', IF NONZERO, IS THE NUMBER OF DAYS OLD THE
ACCESS DATE CAN BE BEFORE SQUASH REFUSES TO STORE THE FILE. THE
DECISION IS BASED ON SIMPLE SUBTRACTION OF DATES, SO AGEREF WILL
OFTEN BE A LITTLE INACCURATE. NOTE THAT THE ACCESS DATE IS NOTE UPDATED
BY SQUASH REGARDLESS OF WHETHER OR NOT A FILE IS STORED.

	BOOKKEEPING:
  IF THE CONSTANT 'BKON' IS NONZERO AT ASSEMBLY, EVERY TIME SQUASH
CREATES A LIBRARY FILE IT WILL RECORD SOME STATISTICS ON A FILE
CALLED 'SQUASH.CNT[PROJCT,PROGCT]<122>' WHERE PROJCT AND PROGCT ARE
OTHER ASSEMBLY CONSTANTS. WHAT IT RECORDS ARE 1)THE NUMBER OF USES,
2)THE NUMBER OF DISK BLOCKS OCCUPIED BY THE FILES STORED
IN THE LIBRARY BEFORE STORAGE, AND 3)THE NUMBER OF DISK BLOCKS TAKEN
BY THE LIBRARY FILE. THE .CNT FILE HAS JUST THOSE 3 ACCUMULATED TOTALS.
THE PROGRAM MASTER.F4 WITH MACRO SUBROUTINE IN MASGET.MAC RETRIEVES
THIS INFORMATION AND GIVES A %IMPROVEMENT. THE .CNT FILE IS INITIALIZED
IF IT ISN'T FOUND BY SQUASH.

	OTHER OPTIONS AND FEATURES:
  PSVBLK:
'PSVBLK' IS THE ADDRESS OF THE TABLE OF FILENAMES SQUASH WILL IGNORE
ON CREATION OF A LIB FILE. A WORD OF 1'S INDICATES WILDCARD EITHER
FOR NAME OR EXTENSION, AND A 0 FILENAME INDICATES THE END OF THE BLOCK.

  TWOSEG:
SQUASH CAN RUN EITHER AS A 1 SEG OR TWOSEG PROGRAM. THE SOURCE IS
SET UP FOR A LOC40-HIGHSEG-LOWSEG LOCATION SEQUENCE, AND PSVBLK CAN
BE PUT IN THE HIGH SEG IF THAT'S DESIRABLE.

  THE CONDITION OF A FILE NOT BEING ON THE UFD WHEN SQUASH GETS IT AT
THE BEGINNING OF DECOMPOSITION, BUT SAID FILE BEING MODIFIED WHEN SQUASH
GOES TO WRITE IT, IS FATAL.

  SQUASH SHOULD PROBABLY NOT BE PROTECTED TO EXECUTE ONLY. THIS HAS
BEEN KNOWN TO MAKE THE ERROR HANDLING UUOS FAIL, INCLUDING NOTIFICATION
OF SUPERCEDE.

  'SLTIM' IS THE SLEEPING TIME IN SECONDS AFTER NOTIFICATION THAT
A SUPERCEDE IS TAKING PLACE, AND SLTIM1 IS THAT AFTER EACH FILENAME
IS TYPED.
*U*=48