English Amiga Board Amiga Lore


Go Back   English Amiga Board > Support > support.Apps

 
 
Thread Tools
Old 09 July 2011, 05:05   #1
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 524
Question 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
tygre is offline  
AdSense AdSense  
Old 09 July 2011, 09:42   #2
mfilos
Paranoid Amigoid

mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 38
Posts: 1,576
Send a message via Skype™ to mfilos
Why don't you redirect your commands output to a file?
Like for example "copy dh0: dh1: ALL CLONE >ram:copylog.txt"
mfilos is offline  
Old 09 July 2011, 15:55   #3
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 524
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
tygre is offline  
Old 09 July 2011, 16:25   #4
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,526
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.
thomas is offline  
Old 09 July 2011, 19:29   #5
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 524
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
tygre is offline  
Old 09 July 2011, 20:40   #6
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,526
Quote:
would it be possible to program a new kind of CON: that would output into a file?
Would be easier to write an IconX that opens its file for writing.

Very easy
Attached Files
File Type: lha NewIconX.lha (4.7 KB, 102 views)
thomas is offline  
Old 09 July 2011, 22:38   #7
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 524
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.
tygre is offline  
Old 09 July 2011, 23:15   #8
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,526
Quote:
but I may have missed something
You need to change the icon's default tool from iconx to newiconx or rename newiconx to iconx.

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.
thomas is offline  
Old 10 July 2011, 05:29   #9
tygre
Returning fan!

tygre's Avatar
 
Join Date: Jan 2011
Location: Montréal, QC, Canada
Posts: 524
Quote:
Originally Posted by thomas View Post
you should not rename newiconx but rather change the icon's default tool.
Weirdly enough, I cannot change the default tool from IconX to NewIconX: I change, press enter (to make sure it is entered), then press save and... it is still IconX that is the default tool Anyhow, I'll figure this one out by myself eventually: NewIconX works perfectly for my purpose! Thanks again Thomas!

Still, has anyone any idea how to create a new device, similar to CON:? Just curious...

Cheers!
Yann
tygre is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
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
redirecting error output to a file jotd support.Apps 2 01 April 2006 09:50

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 03:38.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.23777 seconds with 12 queries