English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 08 March 2018, 19:30   #61
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
every heard of lhasa?
current version on aminet, but a new version is in the making.

the nice feature of lhasa, it does create a configurable folder, where it does extract the archive:
Code:
$ lhasa.exe -ew=new_folder Anim2gif.lha
new_folder/Anim2gif.info        - Melted   :  o
new_folder/Anim2gif/An2gif      - Melted   :  o
...
so you may configure DOpus with the variable of the src-file-name as new destination folder.
maybe it's somehow usefull.
emufan is offline  
Old 08 March 2018, 20:55   #62
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,608
I wonder if it would make sense to define .BRA and .KET as something else than < and >.
idrougge is online now  
Old 24 March 2018, 19:52   #63
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
Updated script:

Code:
.KEY SRC,DST
.DEF SRC "Downloads:"
.DEF DST "RetroStuff:"
LIST <SRC> PAT=#?.lha LFORMAT="LhA x *"%P%N*" *"<DST>%M/*"" >"RAM:Downloads.txt"
LIST <SRC> PAT=#?.lzx LFORMAT="LZX x *"%P%N*" *"<DST>%M/*"" >>"RAM:Downloads.txt"
LIST <SRC> PAT=#?.zip LFORMAT="UnZip *"%P%N*" -d *"<DST>%M*"" >>"RAM:Downloads.txt"
EXECUTE >NIL: "RAM:Downloads.txt"
Foebane is offline  
Old 02 May 2018, 14:59   #64
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
Quote:
Originally Posted by jPV View Post
Maybe because it has parenthesis in its name? They are special characters in AmigaDOS, so I would advice not to use them in file names no matter if it's the reason here or not. By using them you'll end up with trouble sooner or later anyway.. especially if handling such files from scripts.


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.
This is rather late to the party, but are "at signs" (@) also on this list?
Foebane is offline  
Old 02 May 2018, 15:35   #65
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 41
Posts: 12,113
I would avoid them in filenames Foebane...
DamienD is offline  
Old 02 May 2018, 18:50   #66
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
Quote:
Originally Posted by DamienD View Post
I would avoid them in filenames Foebane...
Gordon Bennett, what IS allowed, then? Looks like only alphanumeric and mixed case to me!
Foebane is offline  
Old 02 May 2018, 20:36   #67
jPV
Registered User
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 597
Quote:
Originally Posted by Foebane View Post
Gordon Bennett, what IS allowed, then? Looks like only alphanumeric and mixed case to me!
@ is fine on Amiga AFAIK, and there are many other characters besides the listed ones which do work too, but IMHO it's best to avoid any special characters and keep it simple You never know when you have to copy files to other systems and what could happen there. Keep it plain and don't even use spaces and you're on safer side
jPV is offline  
Old 02 May 2018, 20:57   #68
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,608
Anything but ~ # " ? or any kind of parentheses/brackets is fine.
idrougge is online now  
Old 03 May 2018, 09:11   #69
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,126
You can use every possible character except ":" and "/".
Some others can cause problems under special circumstances, such as command-line parsing, pattern-matching, or for use on pc filesystems.

If you really really really want to be safe, use only caps and 8.3
meynaf is offline  
Old 03 May 2018, 11:12   #70
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
I just ran my usual script (the subject of this thread) on a whole bunch of files with @ in the filenames and I had no problems, and I've read that if there were going to be problems, they would've occurred during this process. But none, so it's fine.
Foebane is offline  
Old 08 May 2018, 09:00   #71
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
Script update:

Code:
.KEY SRC,DST,TXT
.DEF SRC "Downloads:"
.DEF DST "DemoZone:"
.DEF TXT "RAM:Downloads.txt"
LIST <SRC> PAT=#?.exe LFORMAT="COPY *"%P%N*" TO <DST>" ><TXT>
LIST <SRC> PAT=#?.lha LFORMAT="LhA x *"%P%N*" *"<DST>%M/*"" >><TXT>
LIST <SRC> PAT=#?.lzx LFORMAT="LZX x *"%P%N*" *"<DST>%M/*"" >><TXT>
LIST <SRC> PAT=#?.zip LFORMAT="UnZip *"%P%N*" -d *"<DST>%M*"" >><TXT>
EXECUTE >NIL: <TXT>
This time, single downloaded .exe files will also be copied.
Foebane is offline  
Old 10 June 2018, 23:18   #72
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
Latest update:

Code:
.KEY SRC,DST,TXT
.DEF SRC "Downloads:"
.DEF DST "DemoZone:"
.DEF TXT "RAM:Downloads.txt"
LIST <SRC> PAT="2 #?.exe" LFORMAT="COPY *"%P%N*" TO <DST>" ><TXT>
LIST <SRC> PAT="4 #?.exe" LFORMAT="COPY *"%P%N*" TO <DST>" >><TXT>
LIST <SRC> PAT="#?.lha" LFORMAT="LhA x *"%P%N*" *"<DST>%M/*"" >><TXT>
LIST <SRC> PAT="#?.lzx" LFORMAT="LZX x *"%P%N*" *"<DST>%M/*"" >><TXT>
LIST <SRC> PAT="#?.zip" LFORMAT="UnZip *"%P%N*" -d *"<DST>%M*"" >><TXT>
EXECUTE >NIL: <TXT>
Foebane is offline  
Old 14 September 2018, 12:21   #73
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
How can I use parameters instead of set keys like the above? The script is proving to be a bit inflexible at the moment, and I want to be able to set my own FROM and TO directories after the script name on the CLI.

How do I go about doing this, please?
Foebane is offline  
Old 14 September 2018, 12:26   #74
Hewitson
Registered User
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 35
Posts: 2,490
What is the point of this script? Is it so hard to manually extract an archive from the CLI?

You seem to insist on making things so much more difficult for yourself than they need to be. I honestly don't get it.
Hewitson is offline  
Old 14 September 2018, 12:41   #75
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,126
Quote:
Originally Posted by Foebane View Post
How can I use parameters instead of set keys like the above? The script is proving to be a bit inflexible at the moment, and I want to be able to set my own FROM and TO directories after the script name on the CLI.

How do I go about doing this, please?
Typing the script name on the CLI followed by parameters works with your script exactly like it is...
(If you don't want to have default values and have parameters being required, add /A after each parameter which doesn't have a .def entry.)
meynaf is offline  
Old 14 September 2018, 13:13   #76
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
Quote:
Originally Posted by Hewitson View Post
What is the point of this script? Is it so hard to manually extract an archive from the CLI?
It's to extract multiple archives, within folders with the archive names. I like occupying myself with such mini-projects. Bit late to complain about it, aren't you?

Quote:
Originally Posted by meynaf View Post
Typing the script name on the CLI followed by parameters works with your script exactly like it is...
Really? Wow, that's useful! But if I do wish to use parameters, are the quotes optional or required? Does it make any difference?
Foebane is offline  
Old 14 September 2018, 13:27   #77
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,126
Quote:
Originally Posted by Foebane View Post
Really? Wow, that's useful! But if I do wish to use parameters, are the quotes optional or required? Does it make any difference?
Which quotes ?
Do you mean command "param1" "param2" vs command param1 param2 for typing script name and parameters on the cli ?
If so, it's same as any other command, it does not matter unless there are spaces in parameters.
meynaf is offline  
Old 14 September 2018, 13:38   #78
jPV
Registered User
jPV's Avatar
 
Join Date: Feb 2008
Location: RNO
Posts: 597
Quote:
Originally Posted by Foebane View Post
Really? Wow, that's useful! But if I do wish to use parameters, are the quotes optional or required? Does it make any difference?
Heh yeah, the whole point using .KEY is to ask parameters for the script, and .DEF is just used to have some default values if user doesn't happen to give any parameters.

If you wouldn't want an option to give parameters to the script, we wouldn't have used these .KEY and .DEF at all in the first place. We'd probably just used the SET command to set local variables.

You need quotation marks if parameters contain space characters, otherwise not needed.

So, this would work, for example, like these ways:
Code:
batchextractscript Downloads2: DemoZone2: RAM:Downloads2.txt
or giving parameter names
Code:
batchextractscript SRC=Downloads2: DST=DemoZone2: TXT=RAM:Downloads2.txt
and when giving parameter names, you can mix the order
Code:
batchextractscript TXT=RAM:Downloads2.txt SRC=Downloads2: DST=DemoZone2:
etc... and you can replace = character by space too
Code:
batchextractscript TXT RAM:Downloads2.txt SRC Downloads2: DST DemoZone2:
Amiga shell is flexible :)


Quote:
Originally Posted by Hewitson View Post
What is the point of this script? Is it so hard to manually extract an archive from the CLI?
Not an archive, but archives, maybe hundreds of them at once.

Last edited by jPV; 14 September 2018 at 13:45.
jPV is offline  
Old 14 September 2018, 16:53   #79
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Posts: 1,223
I was at work when I posted earlier today, but when I came back I tried what Meynaf suggested and it worked perfectly! Thanks, Meynaf and jPV!

I actually thought that ".DEF" stood for "DEFINE" and not "DEFAULT", that was my error.
Foebane is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.08508 seconds with 16 queries