File problems(ansi c problems) | developer.brewmp.com File problems(ansi c problems) | developer.brewmp.com

Developer

File problems(ansi c problems)

Forums:

I am porting my c code to brew.

I learned that I can't use standard c libraries. So I can't use anything from stdio.h or stdlib.h. But now I met with a problem of FILE definition. I have used FILE *fopen(..) and those of other functions like fget().....

Any good idea about easy solutions?

Thanks.

Read On char at a time from the file.

Read On char at a time from the file.

RTM - FileMgr object and associated functions. Read IGetline too, which will enable you to grab full lines from files. as for writing to file, well, FileMgr is your guy.
Saludos,
Alhiem

RTM - FileMgr object and associated functions. Read IGetline too, which will enable you to grab full lines from files. as for writing to file, well, FileMgr is your guy.
Saludos,
Alhiem

Well, seems i have to change lots of things. as to feof(), what's the best way?
how about do like this:
1. get the file pointer position
int curpos = IFILE_Seek (file,_SEEK_CURRENT,0);
2. Get the file size
int IFILE_GetInfo(IFile * pIFile, FileInfo * pInfo)
if(pInfo.dwsize ==curpos)
then reach the end of the file.

Well, seems i have to change lots of things. as to feof(), what's the best way?
how about do like this:
1. get the file pointer position
int curpos = IFILE_Seek (file,_SEEK_CURRENT,0);
2. Get the file size
int IFILE_GetInfo(IFile * pIFile, FileInfo * pInfo)
if(pInfo.dwsize ==curpos)
then reach the end of the file.

hi..
u can easily gets file size...
n wen u open any file in read mode it will point 2 first position of open file..
so y using IFILE_Seek u can reach at end of file...

hi..
u can easily gets file size...
n wen u open any file in read mode it will point 2 first position of open file..
so y using IFILE_Seek u can reach at end of file...

And read returns zero then the file is in EOF position.

And read returns zero then the file is in EOF position.