home *** CD-ROM | disk | FTP | other *** search
- .key ACTION/A,DRIVE/A,TRACKS/K,FILE/A,START/K,END/K,MODE/K
- .bra {
- .ket }
- .def TRACKS "dos"
-
- ; $VER: xDM CLI v2.0 (29.9.95)
-
- Set xdmaction {action}
- Set xdmdrive {drive}
- Set xdmversion {mode}
- SetENV xdmstart {start}
- SetENV xdmend {end}
-
- If {tracks} EQ "all"
- Set xdmtracks "1"
- EndIf
-
- If {tracks} EQ "dos"
- Set xdmtracks "2"
- EndIf
-
- If {tracks} EQ "some"
- Set xdmtracks "3"
- EndIf
-
- Cd >ENV:xdmorigcd
- Set xdmcd "$xdmorigcd"
-
- If NOT EXISTS ENV:xdm
- If NOT EXISTS ENVARC:xdm
- Set xdm T:
- Else
- Copy >NIL: ENVARC:xdm TO ENV:
- EndIf
- EndIf
-
- If NOT EXISTS ENV:xdmlzx
- If NOT EXISTS ENVARC:xdmlzx
- Set xdmlzx T:
- Else
- Copy >NIL: ENVARC:xdm TO ENV:
- EndIf
- EndIf
-
- If NOT EXISTS C:dd
- Set xdmerror dd
- Skip errorout
- EndIf
-
- If NOT EXISTS C:PackDev
- Set xdmerror PackDev
- Skip errorout
- EndIf
-
- If NOT EXISTS C:LZX
- Set xdmerror LZX
- Skip errorout
- EndIf
-
- If $xdmversion EQ "lowmem"
- If NOT EXISTS ENV:xdm
- Set xdmerror "lowmem"
- Skip errorout
- EndIf
- If NOT EXISTS ENV:xdmlzx
- Set xdmerror "lowmem"
- Skip errorout
- EndIf
- Set xdmmode "lowmem"
- EndIf
-
- LAB startpack
- If $xdmdrive EQ "RAD:"
- Assign >NIL: RAD: EXISTS
- If WARN
- Echo "Mounting RAD:"
- Mount >NIL: RAD:
- EndIf
- EndIf
-
- If $xdmaction EQ "A"
- Skip compress
- EndIf
-
- If $xdmaction EQ "X"
- Skip decompress
- EndIf
-
- LAB compress
- Set xdmdest {file}.xdm
-
- If EXISTS $xdmdest
- Set xdmerror "fileexists"
- Skip errorout
- EndIf
-
- If $xdmtracks EQ "3"
- Eval >ENV:xdmskip $xdmstart*22
- Eval >ENV:xdmcount $xdmend-$xdmstart*22+22
- EndIf
-
- Echo "*n*e[32mxDM v2.0 - © 1995 Adam Chapman*e[0m"
- Echo "Reading disk image... Please wait!"
- Cd "$xdm"
- Date >ENV:xdmdate1
- Echo >ENV:xdmtime1 "$xdmdate1" LEN=5
- Echo >ENV:xdmmins1 "$xdmtime1" FIRST=1 LEN=2
- Echo >ENV:xdmsecs1 "$xdmtime1" LEN=2
-
- If $xdmtracks EQ "3"
- ChangeTaskPri 5
- dd -c$xdmcount -s$xdmskip -r$xdmdrive xDM.dsk
- ChangeTaskPri 0
- List >ENV:xdmfile xDM.dsk LFORMAT %L
- If $xdmfile EQ "empty"
- Echo "Please insert disk into drive $xdmdrive"
- Skip startpack BACK
- EndIf
- Else
- If $xdmtracks EQ "1"
- ChangeTaskPri 5
- PackDev $xdmdrive xDM NC Q ALL
- Else
- ChangeTaskPri 5
- PackDev $xdmdrive xDM NC Q
- EndIf
- ChangeTaskPri 0
- Rename >NIL: xDM.pkd xDM.image
- List >ENV:xdmfile xDM.image LFORMAT %L
- If FAIL
- Echo "Please insert disk into drive $xdmdrive"
- Skip startpack BACK
- EndIf
- EndIf
-
- Echo "Archiving disk image... Please wait!"
-
- If $xdmtracks EQ "3"
- If $xdmmode EQ "lowmem"
- LZX -bi16 -bo16 -m -P5 -U0 -w$xdmlzx -X0 -3 a $xdmdest xDM.dsk ENV:xdmskip ENV:xdmcount
- Skip contcompress
- EndIf
- LZX -m -P5 -U0 -X0 -3 a $xdmdest xDM.dsk ENV:xdmskip ENV:xdmcount
- Else
- If $xdmmode EQ "lowmem"
- LZX -bi16 -bo16 -m -P5 -U0 -w$xdmlzx -X0 -3 a $xdmdest xDM.image
- Skip contcompress
- EndIf
- LZX -m -P5 -U0 -X0 -3 a $xdmdest xDM.image
- EndIf
-
- LAB contcompress
- Date >ENV:xdmdate2
- Echo >ENV:xdmtime2 "$xdmdate2" LEN=5
- Echo >ENV:xdmmins2 "$xdmtime2" FIRST=1 LEN=2
- Echo >ENV:xdmsecs2 "$xdmtime2" LEN=2
- List >ENV:xdmsize $xdmdest LFORMAT %L
- Eval >ENV:xdmpct 100-($xdmsize*100/901120)
-
- If $xdmmins2 GT $xdmmins1
- Eval >ENV:xdmtimer ($xdmmins2*60+$xdmsecs2)-($xdmmins1*60+$xdmsecs1)
- EndIf
-
- If $xdmmins1 GT $xdmmins2
- Eval >ENV:xdmtimer ($xdmmins2+60*60+$xdmsecs2)-($xdmmins1*60+$xdmsecs1)
- Else
- Eval >ENV:xdmtimer ($xdmmins2*60+$xdmsecs2)-($xdmmins1*60+$xdmsecs1)
- EndIf
-
- Echo "Archive size : *e[1;32m$xdmsize*e[0m bytes"
- Echo "Percentage Saving : *e[1;32m$xdmpct*e[0m *e[1;32m%*e[0m"
-
- If "$xdmtimer" NOT EQ "Mismatched parenthesis"
- Echo "Mashing time : *e[1;32m$xdmtimer*e[0m seconds"
- EndIf
-
- Echo "*nProcess complete!"
- Skip getout
-
- LAB decompress
- Set xdmdest {file}
- List >ENV:xdmcheck "$xdmdest" QUICK NOHEAD
- Echo >ENV:xdmcheck2 "$xdmcheck" LEN=3
-
- If $xdmcheck2 NOT EQ "xdm"
- Set xdmerror "notxdm"
- Skip errorout
- EndIf
-
- If NOT EXISTS "$xdmdest"
- Set xdmerror "nofile"
- Skip errorout
- EndIf
-
- If $xdmdrive NOT EQ "RAD:"
- Ask "*nEnsure disk is in $xdmdrive and press [RETURN]"
- EndIf
-
- Date >ENV:xdmdate1
- Echo >ENV:xdmtime1 "$xdmdate1" LEN=5
- Echo >ENV:xdmmins1 "$xdmtime1" FIRST=1 LEN=2
- Echo >ENV:xdmsecs1 "$xdmtime1" LEN=2
- Echo "*n*e[32mxDM v2.0 - © 1995 Adam Chapman*e[0m"
- Echo "Decompressing disk image... Please wait!"
- LZX >NIL: -m -P5 -X0 x $xdmdest ENV: xdmcount xdmskip
- LZX -m -P5 -X0 x $xdmdest "$xdm" xDM.dsk xDM.image
-
- If ERROR
- Set xdmerror "notxdm"
- Skip errorout
- EndIf
-
- FailAt 20
- Cd "$xdm"
-
- If NOT EXISTS xDM.dsk
- If NOT EXISTS xDM.image
- Set xdmerror "notxdm"
- Skip errorout
- EndIf
- EndIf
-
- If EXISTS xDM.dsk
- If NOT EXISTS ENV:xdmcount
- Set xdmunpack 1
- Set xdmcount 1760
- Set xdmskip 0
- Skip unpackcont
- EndIf
- Set xdmunpack 2
- EndIf
-
- If EXISTS xDM.image
- Set xdmunpack 3
- EndIf
-
- LAB unpackcont
- Echo "Writing disk image... Please wait!"
-
- If $xdmunpack EQ "3"
- ChangeTaskPri 5
- PackDev xDM.image $xdmdrive NC Q ETDF
- ChangeTaskPri 0
- Else
- ChangeTaskPri 5
- dd -c$xdmcount -s$xdmskip -w$xdmdrive xDM.dsk
- ChangeTaskPri 0
- EndIf
-
- Echo "Process complete!"
- DiskChange $xdmdrive
- Date >ENV:xdmdate2
- Echo >ENV:xdmtime2 "$xdmdate2" LEN=5
- Echo >ENV:xdmmins2 "$xdmtime2" FIRST=1 LEN=2
- Echo >ENV:xdmsecs2 "$xdmtime2" LEN=2
-
- If $xdmmins2 GT $xdmmins1
- Eval >ENV:xdmtimer ($xdmmins2*60+$xdmsecs2)-($xdmmins1*60+$xdmsecs1)
- EndIf
-
- If $xdmmins1 GT $xdmmins2
- Eval >ENV:xdmtimer ($xdmmins2+60*60+$xdmsecs2)-($xdmmins1*60+$xdmsecs1)
- Else
- Eval >ENV:xdmtimer ($xdmmins2*60+$xdmsecs2)-($xdmmins1*60+$xdmsecs1)
- EndIf
-
- If "$xdmtimer" NOT EQ "Mismatched parenthesis"
- Echo "Decompression time : *e[1;32m$xdmtimer*e[0m seconds"
- EndIf
-
- Echo "*nProcess complete!"
- Skip getout
-
- LAB errorout
- If $xdmerror EQ "fileexists"
- Echo "*nSorry, but that xDM archive already exists."
- Echo "Please give it another filename."
- Skip getout
- Else
- If $xdmerror EQ "nofile"
- Echo "*nSorry, that file does not exist."
- Echo "Please select an existing xDM archive."
- Skip getout
- EndIf
- If $xdmerror EQ "lowmem"
- Echo "*nSorry, you have selected a mode which suggests you have a low memory"
- Echo "situation. However, you do not have the low-memory variable *"xdmlzx*" set"
- Echo "in your ENV: or ENVARC: directories. Please refer to the documentation or"
- Echo "re-install xDM, this time setting the *"xdmlzx*" low-memory variable to a"
- Echo "location somewhere on a harddrive partition with at least 1mb free.*n"
- Skip conterror
- EndIf
- If $xdmerror EQ "notxdm"
- Echo "*nSorry, the file you are trying to unpack is not an xDM archive."
- Echo "Please select a valid archive and try again."
- Skip getout
- EndIf
- Echo "*nSorry, but I cannot find *"$xdmerror*" in your C: directory."
- Echo "Please install xDM or *"$xdmerror*" again."
- EndIf
-
- LAB conterror
- Cd "$xdm"
- Delete >NIL: xDM.dsk xDM.image
- Cd ENV:
- Delete >NIL: xdmaction xdmdev xdmseldrive xdmdest xdmtracks xdmdecompcont xdmskip xdmcount xdmfile xdmsize xdmpct xdmtimer xdmorigcd xdmversion xdmcheck xdmcheck2 xdmdate#? xdmtime#? xdmmins#? xdmsecs#?
- Cd "$xdmcd"
- UnSet xdmdrive
- UnSet xdmcount
- UnSet xdmskip
- UnSet xdmstarttrack
- UnSet xdmendtrack
- UnSet xdmmode
- UnSet xdmunpack
- UnSet xdmcd
- UnSet xdmerror
- UnSet xdm
- UnSet xdmsd
- UnSet xdmlzx
- UnSet xdmaction
- UnSet xdmdest
- UnSet xdmtracks
- FailAt 21
- Quit 20
-
- LAB getout
- Cd "$xdm"
- Delete >NIL: xDM.dsk xDM.image
- Cd ENV:
- Delete >NIL: xdmaction xdmdev xdmseldrive xdmdest xdmtracks xdmdecompcont xdmskip xdmcount xdmfile xdmsize xdmpct xdmtimer xdmorigcd xdmversion xdmcheck xdmcheck2 xdmdate#? xdmtime#? xdmmins#? xdmsecs#?
- Cd "$xdmcd"
- UnSet xdmdrive
- UnSet xdmcount
- UnSet xdmskip
- UnSet xdmstarttrack
- UnSet xdmendtrack
- UnSet xdmmode
- UnSet xdmunpack
- UnSet xdm
- UnSet xdmsd
- UnSet xdmlzx
- UnSet xdmaction
- UnSet xdmdest
- UnSet xdmtracks
- UnSet xdmerror
- UnSet xdmcd
-