[comp.sys.amiga.tech] Reading and writing to CON: windows

UH2@PSUVM.BITNET (Lee Sailer) (10/11/88)

/*
I want to open a window on the WorkBench screen and use it for
simple, old-fashioned input and output ala stdin and stdout.  I
have tried various versions of the code below, without success.
This particular version writes the "Enter string:" OK , but then
immediately adds "you typed ::" before I get a chance to type anything.

So, how do I open a CON: for read and write?  Or more politely, can someone
point me at the info I need.  I have Adler ,Peck, and the Lattice manual,
plus the usual Unix white books.

Thanks.
*/

#include <stdio.h>

main()
{
        FILE *fp;
        char fspec[80];

        fp = fopen("con:10/10/550/50/test input","r+");
        fprintf(fp,"Enter string: ");
        fgets(fspec,80,fp);
        fprintf(fp, "you typed :%s:\n", fspec);

        Delay(600);
        fclose(fp);

}