Amiga.org
Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: on April 03, 2003, 10:19:51 AM
-
The "unix" function fdopen isn't implemented in libnix. how can I solve that? Ripping it from ixemul or rewriting so it uses something else?
-
Roll your own :-)
That's usually what I end up doing. Make a good solid job of it anf put it into your own link library for reuse later.
-
Yes, that was exactly what I was trying to do with the fdopen from the ixemul sources, but I got tangled and dragged down by a viciuos monster called "header". I managed to escape it's grip and went here to ask you, wise man, of advice :)
I though maybe you could give me a secret formula or reveal the monsters weak points so I can slay it.
-
Could you be a tad more specific, old fellow?
Are you having trouble creating a header file?
-edit-
PS don't get too sarcastic :-D
-
Just looking at POSIX compliant fdopen() as defined under Watcom..
To my eye, it looks like youre probably best off replacing the stuff all together with ANSI IO.
Maybe I got this wrong but (from Watcom example doc)
#include
#include
#include
void main()
{
int handle;
FILE *fp;
handle = open( "file", O_RDONLY | O_TEXT );
if( handle != -1 ) {
fp = fdopen( handle, "r" );
if( fp != NULL ) {
/*
process the stream
*/
fclose( fp );
} else {
close( handle );
}
}
}
doesn't look especially useful. You could just use fopen("file", "r") and skip the open() / fdopen() stuff.
Well, in the above example at least :-)