#120711 - 2004-06-07 04:46 PM
Re: KiXbin - kixtart binary access library (cRFC)
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Seek
Seek (as used in 'C') sets the file "cursor", which is where the next read and/or write will happen.
The two most important file postioning functions are:
- ftell(filehandle)
which returns the current cursor position in the file stream.
- fseek(filehandle,position,origin)
which moves to the specific position. "position" may be +/- "origin" may be:
- "from the start of file" (SEEK_SET)
- "from the current position" (SEEK_CUR)
- "from the end of file" (SEEK_END)
Positioning the cursor past the end of file is valid, and will write zeros to the intermediate characters. Positioning the cursor before the start of the file is just plain daft
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 611 anonymous users online.
|
|
|