Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: orange on February 07, 2015, 03:05:47 AM

Title: lha return codes
Post by: orange on February 07, 2015, 03:05:47 AM
what does "lha failed returncode 20" and similar mean?
Title: Re: lha return codes
Post by: Oldsmobile_Mike on February 07, 2015, 03:35:24 AM
Does it do it on every archive?   Using the right version for your processor?
Title: Re: lha return codes
Post by: Tenacious on February 07, 2015, 03:37:28 AM
In AmigaDos, a return code of 20 means a command failed and was aborted.  4-3 of "AmigaDOS" manual.

Are you working from a cli or shell?

Jeepers, Mike never sleeps!  ;)
Title: Re: lha return codes
Post by: Oldsmobile_Mike on February 07, 2015, 03:45:11 AM
Quote from: Tenacious;783233
Jeepers, Mike never sleeps!  ;)

Lucky me, just got home from work.  Before midnight for once!  No big roller derby party this weekend, it's NASA documentaries and amiga.org for me, this exciting Friday night, instead.  ;)

Now on to the guy's problem, I'd ask the usual questions.  Did lha work previously (and just now stopped working), or is this the first time using it?  What sequence of commands is he putting into it?  Does it work if he copies it to ram:, etc.  There's so many ways to troubleshoot this, but without more information it's kind of hard.  ;)
Title: Re: lha return codes
Post by: orange on February 07, 2015, 03:58:08 AM
lha fails on some archives only, executing script, with code 10 or 20.
seems that 20 happens when filename contains nonstandard-ASCII char. but what is 10?
strangely, with error 10, it fails only in script.
thanks.
Title: Re: lha return codes
Post by: Tenacious on February 07, 2015, 04:15:59 AM
Quote from: orange;783236
lha fails on some archives only, executing script, with code 10 or 20.
seems that 20 happens when filename contains nonstandard-ASCII char. but what is 10?
strangely, with error 10, it fails only in script.
thanks.


10 is a script failure.  The codes are not clearly defined in the manual.  Do you have a manual?  Can you list the script here?
Title: Re: lha return codes
Post by: orange on February 07, 2015, 04:43:11 AM
Quote from: Tenacious;783237
10 is a script failure.  The codes are not clearly defined in the manual.  Do you have a manual?  Can you list the script here?


its very simple, albeit long, script:
"

makedir RAM:lhat
lha x -a -r -e -x -M -m -n -q  "PC:lha/dir1/archive1.LHA" RAM:lhat/
lha a -a -r -e -x -M -n -q -z  "PC:lha_out/dir1/archive1.LHA" RAM:lhat/
delete  RAM:#? ALL FORCE QUIET

...
"
er, didn't know there was difference between cli and shell, think this is from cli.

edit: it seems there's a problem in filename. it says "Unable to open output file". is there a way to use utf-8 in cli?
Title: Re: lha return codes
Post by: Tenacious on February 07, 2015, 05:16:27 AM
Quote from: orange;783239
"
er, didn't know there was difference between cli and shell, think this is from cli.

edit: it seems there's a problem in filename. it says "Unable to open output file". is there a way to use utf-8 in cli?

WOW! That's definitely more sophisticated than the way I unarchive stuff (I simply use a menu button in my favorite dir utilities).  Clearly, I'm out of my depth, but interested.  Did you write this script, and if so, what is the intent behind the intricacy?  How do you substitute the name of the archive you are extracting?  It's great to see how others do things.  ;)

I asked about the cli or shell to find out if you were fat-fingering a command each time.
Title: Re: lha return codes
Post by: Tenacious on February 07, 2015, 05:22:48 AM
IIRC, my 'button' unarchives a selected file.lha to my RAM DISK: and gives it a name (output file) and directory structure that the archive dictates.
 I probably don't understand what you're doing.
Title: Re: lha return codes
Post by: Oldsmobile_Mike on February 07, 2015, 05:30:50 AM
Quote from: orange;783239
lha x -a -r -e -x -M -m -n -q  "PC:lha/dir1/archive1.LHA" RAM:lhat/
lha a -a -r -e -x -M -n -q -z  "PC:lha_out/dir1/archive1.LHA" RAM:lhat/

I just looked up about half of those options, and definitely... wow!

+1 curious as to what you're trying to do?
Title: Re: lha return codes
Post by: orange on February 07, 2015, 04:43:33 PM
I'm trying to unarchive each .lha and then repack it in .lha but with zero compression. Later I can pack them all again with 7z, for eg., to achieve (much) higher compression ratio. I've written a perl script that creates this script for every .lha. Because some archives are inside archives, I've done this recursively to second level. But there's a lot of filenames with nonASCII.
Title: Re: lha return codes
Post by: motrucker on February 07, 2015, 04:53:40 PM
I can be very little help here, as I too cheat - using DiskMaster 2 and just mashing the button to un-arc the archive. Thee programs can make us quite lazy, can't they..... (but they're fast)
But, Orange, if you don't have the manual - you can grab a copy at Bombjack.org in PDF format.
Title: Re: lha return codes
Post by: Tenacious on February 07, 2015, 04:57:47 PM
Like many here, you're operating beyond my simple user status.  :)

@ motrucker  Thanks for the link.  I'll check it out, too.
Title: Re: lha return codes
Post by: Tenacious on February 07, 2015, 05:29:55 PM
That's a very impressive repository, even Rob Peck's "The Amiga Companion" is there!
Title: Re: lha return codes
Post by: Thomas on February 07, 2015, 10:03:21 PM
Quote from: orange;783236
lha fails on some archives only, executing script, with code 10 or 20.
seems that 20 happens when filename contains nonstandard-ASCII char. but what is 10?
strangely, with error 10, it fails only in script.
thanks.



10 and 20 mean nothing. They are just standard AmigaDOS return codes for error resp. failure. You have to read the error messages Lha prints out. Don't use >nil: or similar to hide the messages if you need them.
Title: Re: lha return codes
Post by: orange on February 08, 2015, 06:35:48 AM
Quote from: Thomas;783280
10 and 20 mean nothing. They are just standard AmigaDOS return codes for error resp. failure. You have to read the error messages Lha prints out. Don't use >nil: or similar to hide the messages if you need them.


Thanks Thomas.

After doing some tests, I think the aminet archive could be reduced in size to less than 50% with this method.
Title: Re: lha return codes
Post by: Oldsmobile_Mike on February 09, 2015, 05:06:36 AM
Quote from: orange;783296
After doing some tests, I think the aminet archive could be reduced in size to less than 50% with this method.

Neat project, but why would you do this?  LHA has been the standard archive format for Amiga's for something like 20 years, and everybody has it.  I wouldn't even know what to do with a 7z compressed file on my Amiga.  And it's not like hard drive space is expensive, even the entire Aminet isn't that big in the grand scheme of things, anymore.  :huh:

Oh well, good luck anyway!  :)