English Amiga Board


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 16 July 2018, 11:33   #1
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 46
Posts: 1,400
"LIST: Unable to open redirection file" Returncode 10

I have a script which uses the LIST command to redirect the output to a file in the RAM disk, but all of a sudden it no longer works as it did before:

Code:
.KEY SRC,DST,TXT
.DEF SRC "DH1:"
.DEF DST "DH3:"
.DEF TXT "RAM:DZ.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 file is named "DZ" and is stored in S:, and I have the Script attribute set, but still no joy. It's never failed before.

Can someone at least tell me what Returncode 10 means? I can't find a simple straight answer on Google!
Foebane is offline  
Old 16 July 2018, 11:45   #2
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,328
"Returncode 10" simply means there was an error (it's the error level, in link with FailAt command).
The key here is "unable to open redirection file".
You can get this result if RAM:DZ.txt already exists and is write protected in some way.
meynaf is offline  
Old 16 July 2018, 11:46   #3
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 2,407
The standard return codes are 0=OK, 5=WARN, 10=ERROR and 20=FAILED.

If your script was working correctly in the past, you may have replaced the execute command or the shell with a newer version from ThoR. There were some bugs in the execute command recently which should be fixed now. Try to update or downgrade execute and the shell-seg.
PeterK is offline  
Old 16 July 2018, 12:12   #4
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,688
is it normal to use <> as separators? why not using standard {} ?
jotd is offline  
Old 16 July 2018, 13:06   #5
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 46
Posts: 1,400
Quote:
Originally Posted by PeterK View Post
The standard return codes are 0=OK, 5=WARN, 10=ERROR and 20=FAILED.

If your script was working correctly in the past, you may have replaced the execute command or the shell with a newer version from ThoR. There were some bugs in the execute command recently which should be fixed now. Try to update or downgrade execute and the shell-seg.
Nothing has changed in terms of the OS (ClassicWB).

The only thing is that this time I'm using Windows folders as hard drives on WinUAE, whereas in the past I was using actual HDF files.
Foebane is offline  
Old 16 July 2018, 14:45   #6
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,328
Quote:
Originally Posted by Foebane View Post
The only thing is that this time I'm using Windows folders as hard drives on WinUAE, whereas in the past I was using actual HDF files.
Windows folders, huh ? Beware of access rights. It may just be that these folders are not writeable from WinUAE.
meynaf is offline  
Old 16 July 2018, 16:08   #7
BastyCDGS
Registered User
 
Join Date: Nov 2015
Location: Freiburg / Germany
Age: 38
Posts: 61
Send a message via ICQ to BastyCDGS
Hi!

Quote:
Originally Posted by jotd View Post
is it normal to use <> as separators? why not using standard {} ?
If I remember correctly, don't you have to set .BRA and .KET accordingly in order to use < and >?
BastyCDGS is offline  
Old 16 July 2018, 18:57   #8
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 46
Posts: 1,400
Quote:
Originally Posted by meynaf View Post
Windows folders, huh ? Beware of access rights. It may just be that these folders are not writeable from WinUAE.
I've been able to use "Arc Ext" from DOpus with no problems, with Windows folders as both source and destination. No permissions denied, there.

Quote:
Originally Posted by BastyCDGS View Post
If I remember correctly, don't you have to set .BRA and .KET accordingly in order to use < and >?
I got rid of all that stuff and simplified the above script to not use .KEY and .DEF at all, and the error still occurred.
Foebane is offline  
Old 16 July 2018, 19:11   #9
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,328
Quote:
Originally Posted by Foebane View Post
I've been able to use "Arc Ext" from DOpus with no problems, with Windows folders as both source and destination. No permissions denied, there.
The error says it can't open some redirection file. Can you run SnoopDos to check which one it is ?
meynaf is offline  
Old 16 July 2018, 19:21   #10
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,688
Quote:
If I remember correctly, don't you have to set .BRA and .KET accordingly in order to use < and >?
Yes, that sounds correct.

can you show us the new version without <> ?
jotd is offline  
Old 16 July 2018, 19:29   #11
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 46
Posts: 1,400
Quote:
Originally Posted by jotd View Post
Yes, that sounds correct.

can you show us the new version without <> ?
No, as I deleted it, but older versions I had before I used < and > worked fine.

Sorry for the trouble you've all gone to to try and find the issue, but the script was mainly about extracting a whole bunch of demo archives into a folder, but I've since discovered that I don't even need to extract the archives, as a lot of them consist of only one executable which I can just rip out of the archive and place in the folder anyway.
Foebane is offline  
Old 16 July 2018, 21:27   #12
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,688
"it was working before", but before what? In those cases the idea is to get rid of all parasite stuff. This <> stuff is clearly parasiting your diagnostic.
jotd is offline  
Old 16 July 2018, 21:38   #13
Dan
Registered User

Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 421
hmm the > and < symbols alone indicates output and input redirects on their own.

can you try the script with following changes ?

Code:
.KEY SRC,DST,TXT
.DEF SRC "DH1:"
.DEF DST "DH3:"
.DEF TXT "RAM:DZ.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>"
The change are the extra " " around <SRC> and <TXT>.

Edit: this is a bit confusing, but i'm pretty sure that <SRC> <TXT> and <DST> needs to be enclosed in the quotation marks.

Last edited by Dan; 16 July 2018 at 21:51.
Dan is offline  
Old 16 July 2018, 23:42   #14
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,679
Quote:
Originally Posted by BastyCDGS View Post
If I remember correctly, don't you have to set .BRA and .KET accordingly in order to use < and >?
No, < and > are the default brackets. You change them using .BRA/.KET to avoid confusing them with redirection arrows.
idrougge is offline  
Old 17 July 2018, 00:07   #15
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 46
Posts: 1,400
This thread covers the evolution and development of the above script in question, and after lots of help it worked fine for many months, extracting files from archives into HDFs. However, I put it aside to try another method of temporarily extracting files into RAM Disk (Arc Ext in DOpus). Now when I try and bring back the old script for this, it fails.

Thanks for the suggested alterations to the code. I will try them at some point, but I doubt they will work when nothing else did, even formerly working code.
Foebane is offline  
Old 17 July 2018, 03:22   #16
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,679
It's easy to test if it works against a real Amiga hardfile instead of a Windows directory mapping.
idrougge is offline  
Old 17 July 2018, 11:53   #17
Foebane
Registered User
 
Join Date: Sep 2011
Location: Cardiff, UK
Age: 46
Posts: 1,400
So as of now I have a Windows folder with the files to be extracted in it, and I have a non-RDB HDF (the OS HDF is also non-RDB) and I tried my original script (from the last post of the thread I linked to above) and Dan's modified script, but no joy.

Attached is the error message I keep seeing, and using hardfiles hasn't changed a thing.

Although strangely, I found that if I typed out the first LIST line manually in the Shell, then it worked!
Attached Thumbnails
Click image for larger version

Name:	001.png
Views:	25
Size:	31.2 KB
ID:	58876  
Foebane is offline  
Old 17 July 2018, 12:40   #18
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,113
Type "set echo on" in the shell and then lauch your script again. Post the output here.
daxb is offline  
Old 17 July 2018, 13:24   #19
Hedeon
Sonnet Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 843
I have no understanding of scripts, but seeing that you say that the first LIST typed out works, and seeing that it differs from the next three lists.... Why are you using a single > in the first LIST line and a double >> in the other three?
Hedeon is offline  
Old 17 July 2018, 13:32   #20
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 42
Posts: 12,832
>> is append to, where as a single > is just output / redirect to.

Foebane has used the >> so the log doesn't get overwritten and is appended to
DamienD is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
A600, kipper2k's 4mb board, "Whdload failed returncode 10" portarinos support.Apps 8 10 April 2015 17:56
"Unable to open your tool 'Installer' "-Workbench 3.1 Mr B support.Apps 7 31 March 2011 01:14
Unable to open your tool "directory opus' skeediddley support.Apps 3 04 December 2010 04:09
WHDLoad - "Unable to Open your Installer" Sober1977 support.Apps 11 26 December 2007 19:34
"Unable to open your tool" S. Campbell support.WinUAE 31 12 September 2004 21:39

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 20:44.


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