On 13-Jun-2002, Purwadi wrote:
> bytesread = read(fin, work_buf , 8192);
> saat saya print("%d",bytesread);
> yang tercetak adalah 1298.
> Saat saya baca teorynya seharusnya outputnya 8192.
Teori yg mana?
Kalo anda pake Linux, 'man 2 read' berkata demikian:
<quote>
RETURN VALUE
On success, the number of bytes read is returned (zero
indicates end of file), and the file position is advanced
by this number. It is not an error if this number is
smaller than the number of bytes requested; this may happen for
example because fewer bytes are actually available right now
(maybe because we were close to end-of-file, or because we are
reading from a pipe, or from a terminal), or because read() was
interrupted by a signal. On error, -1 is returned, and errno
is set appropriately. In this case it is left unspecified
whether the file position (if any) changes.
</quote>
Ronny
--
Utk berhenti langganan, kirim email ke [EMAIL PROTECTED]
Informasi arsip di http://www.linux.or.id/milis.php3