[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

217.0. "Maintaining remote (and large) ASCII files" by NANUCK::SSMITH (Sheldon Smith @MPO) Wed Mar 05 1986 20:38

The following procedure simplifies maintaining an ASCII file between remote
locations.  A master copy of the file is kept at both locations, and when it is
desired to get changes from one to the other, an update file is moved and
applied to the remote master. 

Example: At local location:         />  At remote location:
        [FOO]BAR.TXT;9             /    [FOO]BAR.UPD;9
        [FOO.MAS]BAR.TXT;3        R     [FOO.MAS]BAR.TXT;3
				 E
        $ @SLP Create BAR.TXT   T       $ @SLP Update BAR.TXT
         yields                A         yields
        [FOO]BAR.UPD;9        L         [FOO]BAR.TXT;9

Also, IF Paul Jensen's TOUCH utility is installed, SLP.COM will use it to keep
the same CREATED / MODIFIED dates on the files at both ends.  You can find
TOUCH in the Toolshed.

$ ! SLP.COM  V1.0
$ ! 
$ ! Purpose:		SLP.COM is intended to facilitate the use of update 
$ !			packets to maintain two copies of the same file at 
$ !			both ends of a slow data line. The idea is that only 
$ !			the update packet need be transferred across the slow 
$ !			line, and the file itself is reconstructed from a 
$ !			master copy of the file. 
$ !
$ !			Clearly, the master copy must be identical at both ends.
$ !
$ !			The reconstructed file will have the same version
$ !			number as the original file.  The version number is
$ !			stored as the version number of the update packet file.
$ !			
$ !			If Paul Jensen's TOUCH program is available, (deter-  
$ !			mined by the existence of Sys$System:TOUCH.exe) then 
$ !			the reconstructed file will also have the same 
$ !			creation and revision dates as the original file.
$ !
$ ! Commands:		SLP CREATE file [master]	! create update packet
$ !			SLP UPDATE file	[master]	! update file from update packet
$ !
$ ! Assumptions:	File is in local directory
$ !			Update packet is (or is created) in local directory
$ !			Master copy of file is in [.MAS] unless P3 specified.
$ !
$ DELETE = "DELETE"
$ DIFFERENCES = "DIFFERENCES"
$ EDIT = "EDIT"
$ GOTO = "GOTO"
$ IF = "IF"
$ INQUIRE = "INQUIRE"
$ RENAME = "RENAME"
$ TOUCH = "TOUCH"
$ MODE = "NONE"
$PARSE1:
$ P1 = "~"+P1
$ IF F$LOCATE( P1, "~CREATE") .NES. F$LENGTH( "~CREATE") THEN GOTO CREATE
$ IF F$LOCATE( P1, "~UPDATE") .NES. F$LENGTH( "~UPDATE") THEN GOTO UPDATE
$ INQUIRE/NOPUNC P1 -
	"Create update packet or Update file from packet? "
$ GOTO PARSE1
$CREATE:
$ MODE = "CREATE_REQUEST"
$ GOTO PARSE2
$UPDATE:
$ MODE = "UPDATE_REQUEST"
$PARSE2:
$ IF P2 .EQS. "" THEN INQUIRE P2 "Enter filespec"
$ IF P3 .EQS. "" THEN P3 = "[.MAS]"
$ IF F$SEARCH( "''P3'''P2'") .EQS. "" -
  THEN INQUIRE P3 "Enter directory of master copy (''P3')"
$ GOTO 'MODE'
$NONE:
$ EXIT
$CREATE_REQUEST:
$ ver = f$verify( 0)
$	UPDATE_FILE = F$PARSE( ".UPD", P2, "SYS$DISK:[]")
$ DELETE 'UPDATE_FILE'*
$ DIFFERENCES/SLP 'P3''P2' SYS$DISK:[]'P2' /OUTPUT=.UPD
$	CDT = f$file_attribute( P2, "CDT")
$	RDT = f$file_attribute( P2, "RDT")
$	UPDATE_FILE = f$search( f$parse( ".UPD", P2, "SYS$DISK:[]"))
$	if f$search( "SYS$SYSTEM:TOUCH.EXE") .nes. "" then -
	   TOUCH 'UPDATE_FILE' /created="''cdt'" /modified="''rdt'" /log
$	INPUT_VERSION = f$parse( f$search( "SYS$DISK:[]''P2'"),,, "VERSION")
$	RENAME 'UPDATE_FILE' 'INPUT_VERSION' /log
$ EXIT ! 'f$verify( ver)
$UPDATE_REQUEST:
$ ver = f$verify( 0)
$ EDIT/SUM 'P3''P2' /UPDATE=SYS$DISK:[] /OUTPUT=SYS$DISK:[]
$	UPDATE_FILE = f$search( f$parse( ".UPD", P2, "SYS$DISK:[]"))
$	CDT = f$file_attribute( UPDATE_FILE, "CDT")
$	RDT = f$file_attribute( UPDATE_FILE, "RDT")
$	OUTPUT_FILE = F$PARSE( P2, "SYS$DISK:[]", P3)
$	if f$search( "SYS$SYSTEM:TOUCH.EXE") .nes. "" then -
	   TOUCH 'OUTPUT_FILE' /created="''cdt'" /modified="''rdt'" /log
$	OUTPUT_VERSION = f$parse( UPDATE_FILE,,, "VERSION")
$	RENAME 'OUTPUT_FILE' 'OUTPUT_VERSION' /log
$ EXIT ! 'f$verify( ver)
T.RTitleUserPersonal
Name
DateLines