Hi, I'm developing an iphone app, I need to create a certain size file on filesystem and filled with NO data first, then seek to a offset and write data when get data from somewhere else
How can I do it?
views:
22answers:
2
+3
A:
The lseek BSD function is explicitly capable of that.
man lseek
:
The lseek() function allows the file offset to be set beyond the end of the existing end-of-file of the file. If data is later written at this point, subsequent reads of the data in the gap return bytes of zeros (until data is actually written into the gap).
Nikolai Ruhe
2010-10-19 11:18:50