2008年7月17日 星期四

fopen , fwrite

fopen
r or rb
Open file for reading.
w or wb
Truncate to zero length or create file for writing.
a or ab
Append; open or create file for writing at end-of-file.
r+ or rb+ or r+b
Open file for update (reading and writing).
w+ or wb+ or w+b
Truncate to zero length or create file for update.
a+ or ab+ or a+b
Append; open or create file for update, writing at end-of-file.

fwrite:
size_t fwrite ( const void * ptr, size_t size, size_t count, FILE * stream );

int fseek(FILE *stream, long offset, int whence)
sets the file position indicator for the stream pointed to by stream
If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively

long ftell(FILE *stream)
obtains the current value of the file position indicator for the stream pointed to by stream.

沒有留言: