Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: AmiNTT on July 21, 2003, 03:49:37 PM

Title: Arexx Help
Post by: AmiNTT on July 21, 2003, 03:49:37 PM
So here's the deal; I would like an arexx script that I can use to copy files created after date "x" on partition "a" into a lha file on partition "b".

I know this shouldn't be too difficult, but its been too long for me since I last messed around in Arexx.  

Help would be most appreciated!

Title: Re: Arexx Help
Post by: Targhan on July 21, 2003, 04:52:39 PM
This kind of depends on what resources you have available.  Are you using Opus5+? OS3.5+?  What kind of external arexx libraries do you have?

I would suggest the following two libraries, and their documentation:

RMH.library
rexxtricks.library

:-)  It'd probably be easier in installer! :lol:
Title: Re: Arexx Help
Post by: Jupp3 on July 21, 2003, 04:58:51 PM
I wonder... Could you do that straight with LHA?

Without arexx?
Title: Re: Arexx Help
Post by: Roj on July 21, 2003, 05:04:44 PM
If you absolutely NEED ARexx, it wouldn't take much to convert this, but here goes...

Edit - Formatting got a bit fried. Oh well, if it's on track and you can't make heads or tails, you know where to find me. ;-)

.KEY SOURCE/A,LHAFILE/A,SINCEDATE/K,ALL/S,SETARCBIT/S
.BRA {
.KET }
.DEF ALL ""

  IF "{SinceDate}" NOT EQ ""
    LIST TO T:ArcFileList{$$} "{Source}" {All} FILES SINCE {SinceDate} LFORMAT "%p%n"
  ELSE
    LIST TO T:ArcFileList{$$} "{Source}" {All} LFORMAT "%p%n"
  ENDIF

; Assuming LhA is in your path

  LhA -iRAM:ArcFileList{$$} a "{LhAFile}"

  IF "{SetArcBit}" NOT EQ ""
    LIST TO T:ArcBitList{$$} "{Source}" {All} FILES SINCE {SinceDate} LFORMAT "protect %p%n +a"
    EXECUTE T:ArcBitList{$$}
  ENDIF

  DELETE T:ArcFileList{$$} T:ArcBitList{$$} QUIET
Title: Re: Arexx Help
Post by: pVC on July 21, 2003, 05:45:03 PM
Oh.. Roj was faster, but I was thinking the same.. here's my quickly made amigados-script for comparison :) I don't take any responsibility of lost data ;)

.KEY filedate/A,sourcepath/A,destpack/A
.BRA {
.KET }

cd {sourcepath}
echo "Scanning directories for archived files at {sourcepath}"
c:list files since {filedate} all lformat %P%N > ram:t/archlist
lha -a -e -x a {destpack} @ram:t/archlist


Example (those lines are written in arkistoi file):

21.Burn:> execute arkistoi 20-jun-03 dh0: ram:sysbackup.lha
Scanning directories for archived files at dh0:
LhA Freeware Version 1.94
Copyright © 1991-94 by Stefan Boberg.
Copyright © 1998 by Jim Cooper.

Creating new archive 'ram:sysbackup.lha':
     Frozen: ( 55.8%)    3905 =>   1724 : S/user-startup
     Frozen: ( 77.2%)    7382 =>   1676 : Utils/Opus5/Buttons/games
     Frozen: ( 76.9%)    7616 =>   1758 : Utils/Opus5/Buttons/gfx

etc...

Title: Re: Arexx Help
Post by: AmiNTT on July 21, 2003, 08:21:07 PM
Okay, so I tried this:
.KEY filedate/A,sourcepath/A,destpack/A
.BRA {
.KET }

cd {sourcepath}
echo "Scanning directories for archived files at {sourcepath}"
c:list files since {filedate} all lformat %P%N > ram:t/archlist
lha -a -e -x a {destpack} @ram:t/archlist

Saved it in c:, set the script bit, and ran it on dh0:  worked fine. (yay!)   I then ran it on DH2: where after a minute, it generated a " c:list failed returncode 20".  I checked the archlist file and the last line indicated "bad template".

Dh2 is my main work partition and probably has 5k files on it.

This looks like a good solution - when I mentioned Arexx, my brain was still in "its Monday" mode.  I mean to say Ados/arexx.

Any idea what the issue is?
Title: Re: Arexx Help
Post by: pVC on July 21, 2003, 08:42:24 PM
Hmmm... hard to say. Look what's the last working file in that archlist file... and then try listing files from around it with list command, if you can find the error in that way.. if it's because of some file :)

And Jupp3 had good point there too, better check if lha has option to pack depending the dates ;)