Welcome, Guest. Please login or register.

Author Topic: Arexx Help  (Read 1495 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AmiNTTTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 176
    • Show only replies by AmiNTT
    • http://www.leroux.ca/
Arexx Help
« 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!


Offline Targhan

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 818
    • Show only replies by Targhan
    • http://www.geocities.com/targhan_aga
Re: Arexx Help
« Reply #1 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:
Regards,
Targhan
 

Offline Jupp3

  • Sr. Member
  • ****
  • Join Date: Mar 2002
  • Posts: 364
    • Show only replies by Jupp3
    • http://jupp3.amigafin.org
Re: Arexx Help
« Reply #2 on: July 21, 2003, 04:58:51 PM »
I wonder... Could you do that straight with LHA?

Without arexx?
 

Offline Roj

  • Sr. Member
  • ****
  • Join Date: Jun 2002
  • Posts: 361
    • Show only replies by Roj
    • http://amiga.org/modules/mylinks/visit.php?lid=247
Re: Arexx Help
« Reply #3 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
I sold my Amiga for a small fortune, but a part of my soul went with it.
 

Offline pVC

Re: Arexx Help
« Reply #4 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...

Daily MorphOS user and Amiga active.
 

Offline AmiNTTTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2002
  • Posts: 176
    • Show only replies by AmiNTT
    • http://www.leroux.ca/
Re: Arexx Help
« Reply #5 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?

Offline pVC

Re: Arexx Help
« Reply #6 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 ;)
Daily MorphOS user and Amiga active.