|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
[UNIX C Programming] refers to how the Bush FILE type Wenjianmiaoshufu into extremes?
Founding documents :
Using fopen () function to return a "FILE *" type;
Using open () function to return to the "int" type;
There is a way to "FILE *" into "int"? ? ? |
[UNIX C Programming] refers to how the Bush FILE type Wenjianmiaoshufu into extremes?
[code]
Typedef struct _iobuf
{
Char* _ptr;
Int _cnt;
Char* _base;
Int _flag;
Int _file; "This is like -------- bars.
Int _charbuf;
Int _bufsiz;
Char* _tmpfname;
FILE;)
#include "Stdio.h>;
Int main (void)
{
Int fd;
FILE* fp;
Char buf[201];
Fp=fopen ( "test.txt", "r");
If (!fp) exit (-1);
Fd = fp->;_file;
Read (fd, buf,100);
Printf ( "%s", buf);
Fclose (fp);
Return 0
}
[/code] |
[UNIX C Programming] refers to how the Bush FILE type Wenjianmiaoshufu into extremes?
Man fileno |
[UNIX C Programming] refers to how the Bush FILE type Wenjianmiaoshufu into extremes?
Thank you for your reply to! ! ! I have just found this function :
Int fileno (FILE *stream);
Its statement is : "The function fileno examines the argument stream and returns its integer descriptor. . " |
[UNIX C Programming] refers to how the Bush FILE type Wenjianmiaoshufu into extremes?
Oh, this is generally not necessary to apply, Solaris enough, many experts put the document in the database has been established |
[UNIX C Programming] refers to how the Bush FILE type Wenjianmiaoshufu into extremes?
File descriptor has its own advantages, and sometimes much more useful than Solaris, particularly in some of the equipment to open on non-document |
| |