Re: gnome_vfs_read returns EOF when requesting zero bytes



On Mon, 2005-02-21 at 11:25 +0100, Mathieu Lacage wrote:
>On Mon, 2005-02-21 at 08:59 +0100, Alexander Larsson wrote:
>> On Sat, 2005-02-19 at 17:26 +0100, Johan Ersvik wrote:
>> > Hi,
>> > I noticed that the call gnome_vfs_read(handle, buffer, 0, &nchars)
>> > returns GNOME_VFS_ERROR_EOF. Is this on purpose or just a boundary case
>> > that has gone unnoticed? The documentation didn't clear things up much
>> > either. Rather it implies that the above call should return
>> > GNOME_VFS_OK.
>> 
>> I  consider this a bug. 
>> 
>> However, in the case where we have actually reached EOF, what should it
>> return then? I guess returning GNOME_VFS_OK in this case is ok too,
>> since you might say the operation succeeds before "reaching" the end of
>> the file.
>
>yes. I believe the semantics are that EOF is raised only when you try to
>read past the end of the file.
>
>Mathieu

I agree. So should we fix this in gnome_vfs_read,
gnome_vfs_read_cancellable or directly in the affected modules? Can I
send a patch somewhere (bugzilla/list) or does any commit authorized
person feel like just adding the check? :)

Johan




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