pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Fsys read/write return value.


From: Michael Gold
Subject: Re: [pdf-devel] Fsys read/write return value.
Date: Thu, 14 May 2009 19:44:50 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Thu, May 14, 2009 at 02:03:26 -0300, gerel wrote:
> 
> Hi,
> 
> The return description for fsys file read/write is wrong when using the 
> default
> disk implementation, since fread/fwrite return the number of 'elements'
> read/written, not the number of octets.
> For them to return the number of octets they should be called like:
> 
>   fread/fwrite (data, 1, num_elems, file); /* note the '1' there */
...

I just noticed this too, and mentioned it in another message.

Is it necessary to support element sizes other than 1?  It may add
complexity for filesystem implementations that don't use fread, such as
network filesystems (for example, recv only supports bytes, so anything
using recv would need to implement some buffering in case the number of
bytes returned isn't evenly divisible by num_elems).

Removing num_elems (and always using byte counts) would avoid this type
of complexity.

-- Michael

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]