This message was edited by Mr_Smith at 2003-8-23 12:15:52
This message was edited by Mr_Smith at 2003-8-23 11:30:19
: This message was edited by stober at 2003-8-23 11:25:28
: : Hi
: : Im writing a program which needs to be able to create a FILE struct on its own to work with the standard fread etc commands, does anyone know the format for the FILE struct on windows (MS Vis studio6)
: :
: : From the header
: : truct _iobuf {
: : char *_ptr;
: : int _cnt;
: : char *_base;
: : int _flag;
: : int _file;
: : int _charbuf;
: : int _bufsiz;
: : char *_tmpfname;
: : };
: : typedef struct _iobuf FILE;
: :
: : im not to sure whats what, looking at other files loading brings me to think
: :
: : ptr is a pointer to the current data
: : and base is the filename
: :
: : which all seems to work except i cant get fseek to work, does anyone know what the other variables are for like a position or offset ?
: :
:
: It's not necessary, nor is it advisable, to monkey abound with the members of the FILE structure. All you, the programmer, have to do is pass the pointer returned by fopen() around to all the other functions such as fseek, fread, fwrite, fgets, fprintf, fclose, etc.
:
: You can find a description of all these functions and their parameters is nearly every textbook written about C language and on many on-line tutorials. you will also find them at www.msdn.microsoft.com.
:
: If you can't get fseek() to work, you need to post some code so that we can see what you are doing.
:
:
:
What im doing is loading a file from a custom archive, i have
char *Data
int Length
i want this to be put into the FILE form
FILE *FileOut;
FileOut->_base= myFile->Data;
FileOut->_ptr = myFile->Data;
FileOut->_cnt = myFile->length;
as i havent got the option of modifing the code that reads it only the file pointer i send to it.
Also MSDN doesnt seem to have ANY info on the FILE struct :(