09 July 2011, 05:05 | #1 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,451
|
How to redirect the output of IconX to a file
Dear all!
I am using IconX to run scripts. Usually, I use the tooltype: "WINDOW=KCON:<bunch of parameters>" to see the output of my scripts in a KCON window. Now, how could I redirect the output to a file? I thought that it would be simple to tell IconX to redirect its output to a file instead of a console but then realised that there is no device "FILE:". I tried to use the tootype "WINDOW=RAM:Somefile.txt" but it does not work: no file "Somefile.txt" is created in RAM:. I think that I am missing something here but... what? Thanks in advance! Yann |
09 July 2011, 09:42 | #2 |
Paranoid Amigoid
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
|
Why don't you redirect your commands output to a file?
Like for example "copy dh0: dh1: ALL CLONE >ram:copylog.txt" |
09 July 2011, 15:55 | #3 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,451
|
Well, yes, but it is so much less elegant and so much more changes! IconX can redirect its output to CON:, KCON:, or NIL: so why not to a file?
Any idea or advice? Yann |
09 July 2011, 16:25 | #4 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,041
|
Run Snoopdos and you will see it: the file name specified behind WINDOW= is opened for input. This works fine for windows where you read and write, but fails for real files.
There are replacements for iconx. One famous is Xicon. I don't know if it works better, just a hint what to search for. |
09 July 2011, 19:29 | #5 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,451
|
Thanks Thomas! I checked XIcon, CLICon, CLIExe, ToolX but none seems to offer the possibility to redirect the output to a file...
I am wondering now, what is a "CON" exactly? I found that a CON: replacement, called RCON, has a logging feature (but only activited from user-controlled menus), would it be possible to program a new kind of CON: that would output into a file? Has anyone tried to program such a device before? How do they exactly work? Could anyone help/guide me? Cheers! Yann |
09 July 2011, 20:40 | #6 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,041
|
Quote:
Very easy |
|
09 July 2011, 22:38 | #7 |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,451
|
Very cool, Thomas Thanks a lot!
So, the "magic" is in the line: "out = Open(win, MODE_NEWFILE);" where the output is really opened? I tried it out but no file is created: when the file given as parameter to WINDOW is missing, SnoopDOS reports an Open and a Read that fail; when the file exists, SnoopDOS does not report anything (but I may have missed something...) I tried using "WINDOW=RAM:Log.txt". What am I doing wrong? Cheers! Yann Last edited by tygre; 09 July 2011 at 23:04. |
09 July 2011, 23:15 | #8 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,041
|
Quote:
Note that newiconx is not a full replacement for iconx. With newiconx you cannot read input from a window because the input handle supplied is 0. The documented way to have input and output handle equal is to supply the handle as input and supply 0 as output. I did it the other way round which might not be legal. It works for your purpose (output to a file) but is not a general solution. To cut it short, you should not rename newiconx but rather change the icon's default tool. |
|
10 July 2011, 05:29 | #9 | |
Returning fan!
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 1,451
|
Quote:
Still, has anyone any idea how to create a new device, similar to CON:? Just curious... Cheers! Yann |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
redirecting error output to a file | jotd | support.Apps | 3 | 06 April 2023 01:59 |
SnoopDOS with Output File Limit | tygre | support.Apps | 6 | 12 December 2015 16:54 |
IconX Error on Startup | kratam | support.Apps | 1 | 11 August 2012 02:02 |
Shell output to log file | Bloodwych | support.Apps | 3 | 22 December 2009 14:03 |
CU Amiga Feb 1994 redirect mistake | spirit | AMR data problems | 3 | 24 September 2007 09:44 |
|
|