[comp.sys.amiga.tech] CLI I/O help needed...

GIUSTI@S37.Prime.COM (04/11/90)

A quick, humble question for the Amiga Guru Netters:

I'm trying to write a simple program that is to be invoked at the CLI
level.  Its purpose is to display to the CLI screen formatted information
about the current directory.  My question, what is the best "legal" way
of accessing the CLI window for formatted text output?  I want to avoid
using "printf" (this is an exercise in Amigados!), and I have to be able
to determine current CLI screen size in order to format the text properly.

I've noticed the amigados Process structure has a pointer to a Console
Task.  This appears to be what I am looking for, but I don't know how
to get at the console through this pointer.  How can I use the
console device I/O given this pointer?

Thanks

Ken Giusti (Giusti@S37.prime.com)
"Don't try to keep up with the Joneses,
rather, try to make them sink to your own level."

deven@rpi.edu (Deven T. Corzine) (04/13/90)

On 11 Apr 90 12:53:00 GMT, GIUSTI@S37.Prime.COM said:

GIUSTI> I'm trying to write a simple program that is to be invoked at
GIUSTI> the CLI level.  Its purpose is to display to the CLI screen
GIUSTI> formatted information about the current directory.  My
GIUSTI> question, what is the best "legal" way of accessing the CLI
GIUSTI> window for formatted text output?  I want to avoid using
GIUSTI> "printf" (this is an exercise in Amigados!), and I have to be
GIUSTI> able to determine current CLI screen size in order to format
GIUSTI> the text properly.

You might try looking at the source to LS 3.1; it was posted recently.

GIUSTI> I've noticed the amigados Process structure has a pointer to a
GIUSTI> Console Task.  This appears to be what I am looking for, but I
GIUSTI> don't know how to get at the console through this pointer.
GIUSTI> How can I use the console device I/O given this pointer?

The pr_ConsoleTask pointer in the Process structure is a (real)
pointer to the pr_MsgPort field in the Process structure of the
console handler device -- i.e. CON:...  runback replaces this field
with a pointer to NULL: instead to background programs more
effectively, so a program openning "*" won't hold the window open.  If
you just want to talk to the console, you can open "*", but it's
probably nicer to use Output() instead.

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.