home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Games 1996 January
/
amigagames-cdrom-1996-01.iso
/
archive
/
userbox
/
publicdomain
/
filer3_24.lha
/
Filer
/
Rexx
/
TTar.filer
< prev
next >
Wrap
Text File
|
1995-08-14
|
4KB
|
165 lines
/*
$VER: TTar.filer 1.3 (14.8.95)
Author:
Michael Böhnisch <billy@uni-paderborn.de> (mb)
Matthias Scheler <tron@lyssa.owl.de> (ms)
Function:
Basic Tar/SCSI Tape interface for Filer. Combined with BTN
Tape handler, "tape.filer" and tar (included in BTN
distrib.) it's very easy to make Filer act as a simple
backup program.
Requires:
BTN Handler installed (from Fish Disk #558)
tar (from BTN distribution)
Streamer device
Call:
TTar READ Tape tar archive --> selected directory
TTar WRITE Selected files/dirs --> Tape tar archive
TTar LIST List tape tar archive
TTar DIFF Compare tape tar archive <--> selected dir
Example for Filer.RC:
XBUTTON 2,0,0,5,">>> Tape","TTar WRITE"
XBUTTON 2,1,0,5,"Tape >>>","TTar READ"
XBUTTON 2,2,0,7,"List","TTar LIST"
XBUTTON 2,3,0,1,"Verify","TTar DIFF"
(see also "tape.filer")
History:
23.09.93 1.0 Initial Release (mb)
26.11.93 1.1 Review for Filer 3.10 Gamma 2 (mb)
19.06.95 1.2 removed some flaws (ms)
14.08.95 1.3 added "QUIET" to "DELETE" call (ms)
*/
PARSE ARG Cmd
OPTIONS RESULTS /* aquire results */
PANEL OFF /* switch command buttons off */
TEMPFILENAME
tmpfile = RESULT
ALERTBOX "Please insert medium into tape drive!"
SELECT
/* ------------------------------------------------------------------ */
/* Read Tar archive from Tape to selected directory */
/* ------------------------------------------------------------------ */
WHEN Cmd = 'READ' THEN DO
GETSOURCEPATH
IF RESULT = 'RESULT' THEN
DO
PANEL ON
EXIT 5
END
dir = RESULT
PRAGMA('D', dir)
GETNUMENTRIES
IF RESULT = 'RESULT' THEN
DO
PANEL ON
EXIT 5
END
Anzahl = RESULT
"EXEC Tar xvR"
UPDATESOURCEDIR
HISTORY "TTar: Tar Archiv extracted to" dir
END
/* ---------------------------------------------------------------- */
/* Write selected files/archives from source directory to Tape tar */
/* archive */
/* ---------------------------------------------------------------- */
WHEN Cmd = 'WRITE' THEN DO
GETSOURCEPATH
IF RESULT = 'RESULT' THEN
DO
PANEL ON
EXIT 5
END
dir = RESULT
PRAGMA('D', dir)
GETNUMENTRIES
IF RESULT = 'RESULT' THEN
DO
PANEL ON
EXIT 5
END
Anzahl = RESULT
OPEN('TMP', tmpfile, 'WRITE')
DO i = 1 TO Anzahl
GETNAME i
IF RESULT = 'RESULT' THEN
DO
PANEL ON
EXIT 5
END
Eintrag = RESULT
Type = LEFT(Eintrag, 1) /* parse filetype (f, d, F, D) */
Name = SUBSTR(Eintrag, 2) /* parse filename */
IF Type = 'd' | Type = 'f' THEN DO
WRITELN('TMP', Name)
TOGGLEENTRY i
HISTORY "TTar: adding" Name "to TAPE tar archive"
END
END
CLOSE('TMP')
"EXEC Tar cvRT" tmpfile
"EXEC Delete" tmpfile "QUIET"
END
/* ---------------------------------------------------------------- */
/* List files in tar Tape archive */
/* ---------------------------------------------------------------- */
WHEN Cmd = 'LIST' THEN DO
"EXEC Tar tvR"
END
/* ---------------------------------------------------------------- */
/* Compare tar archive to filesystem data */
/* ---------------------------------------------------------------- */
WHEN Cmd = 'DIFF' THEN DO
GETSOURCEPATH
IF RESULT = 'RESULT' THEN
DO
PANEL ON
EXIT 5
END
dir = RESULT
PRAGMA('D', dir)
"EXEC Tar dvR"
END
/* ---------------------------------------------------------------- */
/* Just in case someone calls this from Shell/CLI */
/* ---------------------------------------------------------------- */
OTHERWISE DO
SAY "Use from Filer® only!"
END
END
PANEL ON