06 March 2018, 15:02 | #41 | |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
Quote:
Here's what Amiga manuals tell: Colons (:) and slashes (/) are reserved and cannot be used in file or directory names. Semicolons (;), asterisks (*), parentheses (()), question marks (?), back apostrophes (`), number or pund signs (#), square brackets ([]), angle brackets (<>), tildes (~), vertical bars (|), dollar signs ($), double quotation marks ("), and percent signs (%) are not reserved; however, we recommend that you do not use these characters in your file or directory names because they have special meaning in AmigaDOS. |
|
06 March 2018, 15:07 | #42 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
I'm not intended to make thing more complicated and I do not use DOpus,
but Diskmaster2 - on aminet, which seems down atm. with zip archives, I also get wrong or not-set file attributes, zip does not preserves them. what I do with diskmaster2, I was adding menu entries. with diskmaster2 you allways have 2 listers, one source (%n) the other destination (%d). so I select the archives (source) and use my "Archive --> Destination" entries. so the archives get extracted in the destination location. the config entries - 4 entries, each deals with one type of archive, for SYS:S/Diskmaster2.prefs looks like this: Code:
AddMenu Archives, Lha X >Dest, StdIO "CON:0/12/640/180/DM2";Extern Lha x %n %d;StdIO CLOSE AddMenu Archives, Lzx X >Dest, StdIO "CON:0/12/640/180/DM2";Extern Lzx x %n %d;StdIO CLOSE AddMenu Archives, UnZip >Dest, StdIO "CON:0/12/640/180/DM2";Extern unzip %n -d %d;StdIO CLOSE AddMenu Archives, UnRar >Dest, StdIO "CON:0/12/640/180/DM2";Extern unrar x %n %d;StdIO CLOSE Last edited by emufan; 06 March 2018 at 15:14. |
06 March 2018, 15:10 | #43 | ||
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Quote:
The Delete command is at the start in case there is a problem running the script, so by deleting any old script at the start then X.txt will be sure to be blank before the lists are added and then executed. I've been doing it like this for a long time, and there was never a problem with repeating executions, which have only happened very recently. What are DOpus flags? Quote:
EDIT: I'm surprised I didn't realise it would cause a conflict, when I already removed the brackets from .lha archives that would be used on Amiga already, only a few weeks before. D'oh! Last edited by Foebane; 06 March 2018 at 15:50. |
||
06 March 2018, 16:09 | #44 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
|
06 March 2018, 17:09 | #45 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
You can optimize it a bit If you'd use ">" (single) redirection at the first list line (lha) then it'd start a new file always (no matter if there is an old file or not, it will be a fresh file always) and you don't need the delete line. Keep the ">>" (double) redirection just for the other lines (lzx and zip).
|
06 March 2018, 18:19 | #46 | |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Quote:
|
|
06 March 2018, 19:11 | #47 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
|
06 March 2018, 20:20 | #48 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
|
07 March 2018, 11:27 | #49 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
The latest (last?) version of my script. More efficient than ever, thanks to people here for their advice!
|
07 March 2018, 12:36 | #50 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Delete the script (.txt) after executing it is still an option if you don't want to have it sitting in RAM.
|
07 March 2018, 15:22 | #51 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
|
07 March 2018, 17:02 | #52 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
Maybe changing those X:%N ones to %P%N would make it easier to update it later, if you want to change the location from where files are scanned.
I couldn't resist making an über cool (tm) more complicated and feature rich version of this script, sorry Maybe it would be fine learning material for anyone who would like to go deeper into wonderful world of Amiga shell scripting :P It shows some information while progressing and also notifies if there were any errors in archives. You can also define different source and/or destination directories. Here it is: Code:
.KEY SOURCE,DEST .DEF SOURCE X: .DEF DEST RetroStuff:X/ ; ^ ; User can give source and destination direcotries, but defaults are also provided. ; Note that DEST must end with : or / always! ; Let's not stop on unarchiving errors, but handle them in our script. FAILAT 20 ; Print some information in bold. ECHO "*E[1mUnpacking archives from <SOURCE> to <DEST>*E[22m" ECHO "Scanning dir..." ; Let's use escape sequences to print information over the same line always. We'll handle any errors too. LIST <SOURCE> PAT=#?.lha LFORMAT="ECHO *"**E[1F**E[K%P%N*"*NLhA -q x *"%P%N*" *"<DEST>%M/*"*NIF WARN*N ECHO *"**E[1F**E[KERROR IN: %P%N**E[1E*"*N SET ERR TRUE*NENDIF" > T:X.txt LIST <SOURCE> PAT=#?.lzx LFORMAT="ECHO *"**E[1F**E[K%P%N*"*NLZX -q x *"%P%N*" *"<DEST>%M/*"*NIF WARN*N ECHO *"**E[1F**E[KERROR IN: %P%N**E[1E*"*N SET ERR TRUE*NENDIF" >> T:X.txt LIST <SOURCE> PAT=#?.zip LFORMAT="ECHO *"**E[1F**E[K%P%N*"*NUnZip >NIL: -o *"%P%N*" -d *"<DEST>%M*"*NIF WARN*N ECHO *"**E[1F**E[KERROR IN: %P%N**E[1E*"*N SET ERR TRUE*NENDIF" >> T:X.txt EXECUTE T:X.txt ECHO "*E[1F*E[KDONE." ; If there was an error, let's wait that nothing closes the window too quickly if launched from DOpus etc. IF $ERR EQ "TRUE" UNSET ERR WAIT 10 ENDIF Last edited by jPV; 08 March 2018 at 07:16. |
07 March 2018, 20:48 | #53 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I like your adaptation of my script, but I'm wondering what errors there could be when extracting them. I usually test the archives on the PC side with 7-zip, to make sure there are no problems there.
|
07 March 2018, 21:08 | #54 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
I guess it's unlikely to see any then, but doesn't hurt to check for them either Anyway if someone wants to use this for other cases etc... will be good to see if something fails.
|
08 March 2018, 06:37 | #55 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I loved the idea of the source and destination variables so much I implemented them into my own script, which now looks like this:
Code:
.KEY SRC,DST .DEF SRC X: .DEF DST RetroStuff:X/ LIST <SRC> PAT=#?.lha LFORMAT="LhA x *"%P%N*" *"<DST>%M/*"" >RAM:X.txt LIST <SRC> PAT=#?.lzx LFORMAT="LZX x *"%P%N*" *"<DST>%M/*"" >>RAM:X.txt LIST <SRC> PAT=#?.zip LFORMAT="UnZip *"%P%N*" -d *"<DST>%M*"" >>RAM:X.txt EXECUTE >NIL: RAM:X.txt Have you tried your script with zip files? I notice you have a trailing slash in the UnZip command, like the other two, but it won't work with it. |
08 March 2018, 07:10 | #56 | ||
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
Quote:
Quote:
Last edited by jPV; 08 March 2018 at 07:16. |
||
08 March 2018, 09:24 | #57 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I discovered that the UnZip command cannot extract the .zip archives if the destination folder does not already exist, but it's no big issue. I tried to use MAKEDIR <DST> but no such luck.
Also, the "script running twice" bug is back. I thought Ctrl+D would abort it, but it didn't work. What is causing it to run twice? |
08 March 2018, 16:02 | #58 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
jPV, do you know what would happen if I use "RUN" on a script instead of "EXECUTE"?
|
08 March 2018, 18:58 | #59 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
It will say something like can't execute file. If you set script bit on x.txt first, then should work. Why do you want to use RUN or do you mean the script you start manually?
|
08 March 2018, 19:11 | #60 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I'm just wondering why, when the script is run as you describe above, it completes but then it runs once again automatically and asks if I want to overwrite the files I've just extracted! It should only run once, and sometimes it does, but sometimes it runs again immediately. Why?
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unable to extract NDK39.lha | Hiddenevil | support.Apps | 8 | 06 November 2017 11:14 |
Using Xdftool with LHA archives.. | bugsymalone666 | support.Other | 6 | 25 June 2017 02:27 |
Self Extracting LHA Archives | hipoonios | support.Apps | 7 | 16 January 2015 23:15 |
Dopus suddenly won't extract LhA Files | manic23 | support.Apps | 3 | 30 March 2013 13:43 |
Any app to extract multiple archives??? | keropi | support.Apps | 4 | 02 April 2007 13:21 |
|
|