01 February 2018, 08:59 | #1 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Need to extract batch of .lha archives into folders
On ClassicWB, how do I extract a whole folder of .lha archives (and sometimes .lzh archives) into a target folder, so that the contents of each archive are in a folder named after the archive? I would prefer to use the Shell, but I don't know the switches used.
I emulate ClassicWB with WinUAE and could extract the files easily on the Windows side, but I've found issues with character code pages when I do it that way. |
01 February 2018, 09:45 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,033
|
Code:
list #?.lha lformat="lha x %n %m/" >ram:script execute ram:script |
01 February 2018, 09:53 | #4 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I recently took a whole bunch of .lha archives and extracted them into folders with 7-Zip on the Windows side, then simply ran WinUAE and copied them over onto Amiga hard drives. There's no real harm in doing it that way, if the characters are plain ASCII 32-127, right?
I had trouble with a few of them that used specialised characters in the filenames in the contents that showed up one way in Windows and entirely differently on Amiga, and once transferred to Amiga, those files disappeared. I'm really after a simple solution: extract on Windows and only extract (with DOpus) on Amiga IF this ASCII problem occurs. It seems the only thing I have to do is to download the .lhas again and scrutinise the filenames in the contents, looking for unusual characters. |
01 February 2018, 10:00 | #5 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
|
01 February 2018, 10:14 | #6 | |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
|
Quote:
The Shell commands posted by thomas look like they're just what you need to extract all the archives on the Amiga side - that's the approach I would recommend. |
|
01 February 2018, 10:18 | #7 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
They're only Demoscene prods, Daedalus, I doubt the attributes would make much difference.
Besides, a lot of the files I download are .exes and uncompressed anyway, and those attributes are already lost. |
01 February 2018, 10:28 | #8 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,358
|
Quote:
If you want to extract both with a single command, you can do it this way : Code:
list #?.(lha|lzx) lformat="lzx x %n %m/" >ram:script execute ram:script |
|
01 February 2018, 10:53 | #9 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
As others have said; I always extract .LHZ / .LHA archives inside Amiga emulation and not via Windows...
Specialised characters, spaces etc. and also loosing protection bits, comments etc. |
01 February 2018, 11:32 | #10 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I tried it this way:
Downloaded the archives in Windows (from Chrome) and then moved them from Downloads folder to a folder named "X" for temporary files. WinUAE configurations point to "X" as a hard drive on the Amiga side. On the Amiga, ran the script on X drive and then moved all extracted folders over to target drive (.vhd file). I think this works best, as the archives are extracted on the Amiga side. I've already "reinstalled" the files on one of my drives this way. It was a bit more long-winded, but I think it's more "authentic", somehow. I just need practice on DOpus and Shell. It's been way too long. Last edited by Foebane; 06 March 2018 at 15:18. |
01 February 2018, 11:44 | #11 | |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,060
|
Quote:
I advise you NOT to extracting your files in a non Amiga FS. When you extract your files you should directly extract them on the .vhd (Amiga FS formatted) drive. |
|
01 February 2018, 11:51 | #12 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
Don't worry malko; you'll get to know Foebane...
He'll ask a lot of questions, get good / solid advise from people and then still do things his own way |
01 February 2018, 12:09 | #13 | ||
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Quote:
OK, so if I'm in the X drive with the archives, and I would like to extract them straight to, say, "Demos" in the .vhd, then do I modify Thomas' script to say the following? Code:
list #?.lha lformat="lha x %n demos:%m/" >ram:script execute ram:script Code:
list #?.lha lformat="lha x %n demos a-f:%m/" >ram:script execute ram:script Quote:
|
||
01 February 2018, 12:52 | #14 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,357
|
Actually, UAE tends to take care of that. As long as you do all your file operations inside the emulated Amiga, the exact storage of the files doesn't matter since UAE adds Amiga-specific attributes to special files or special fields in the Windows filesystem.
|
01 February 2018, 14:47 | #15 | |||
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,060
|
Quote:
Quote:
Quote:
@Foebane if not already red, you have a good explanation here (Using Directory Hard Drive part). |
|||
01 February 2018, 19:41 | #16 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
I have spent an hour on this problem, and I think I've come up with a good way to automate the extraction from archives in X to the .vhd, and to copy folders containing exe files directly to the .vhd too. I just specify the final names I would like them to have on the Windows side, then run this:
Code:
x: list #?.lha lformat="lha x *"%n*" *"demos:%m/*"" >xarc list dirs lformat="copy *"%n*" to *"demos:%n*" all" >xfol execute xarc execute xfol EDIT: Changed the script as only folder contents were being copied, rather than the folders themselves. Last edited by Foebane; 01 February 2018 at 21:26. |
01 February 2018, 22:15 | #17 | |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 5,060
|
Quote:
If you want you may add a "-a" in your lha command. I let you check the help file included with lha for the meaning of this option |
|
01 February 2018, 22:28 | #18 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
...or display the syntax via Shell / CLI and then:
<program> ? |
02 February 2018, 01:23 | #19 |
Banned
Join Date: Sep 2011
Location: Cardiff, UK
Age: 51
Posts: 2,871
|
Eh?
EDIT: Never mind this response, I was out of it last night and not thinking straight. Last edited by Foebane; 02 February 2018 at 12:00. |
02 February 2018, 09:19 | #20 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
|
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 |
|
|