[ 
https://issues.apache.org/jira/browse/AVRO-1238?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666415#comment-13666415
 ] 

Hudson commented on AVRO-1238:
------------------------------

Integrated in AvroJava #376 (See [https://builds.apache.org/job/AvroJava/376/])
    AVRO-1238. C: EOF detection in avro_file_reader_read_value

This function now returns the builtin `EOF` constant when end-of-file is
detected.  `0` still indicates a successful read, and other results indicate
errors.

Contributed by Michael Cooper. (Revision 1486051)

     Result = SUCCESS
dcreager : 
Files : 
* /avro/trunk/CHANGES.txt
* /avro/trunk/lang/c/src/avro/io.h
* /avro/trunk/lang/c/src/avrocat.c
* /avro/trunk/lang/c/src/avromod.c
* /avro/trunk/lang/c/src/avropipe.c
* /avro/trunk/lang/c/src/datafile.c
* /avro/trunk/lang/c/src/io.c
* /avro/trunk/lang/c/tests/CMakeLists.txt
* /avro/trunk/lang/c/tests/avro-1238-good.avro
* /avro/trunk/lang/c/tests/avro-1238-truncated.avro
* /avro/trunk/lang/c/tests/test_avro_1238.c

                
> Avro-C better end of file detection
> -----------------------------------
>
>                 Key: AVRO-1238
>                 URL: https://issues.apache.org/jira/browse/AVRO-1238
>             Project: Avro
>          Issue Type: Improvement
>          Components: c
>            Reporter: Michael Cooper
>         Attachments: 
> 0001-AVRO-1238.-C-Check-for-EOF-when-reading-from-Avro-fi.patch, 
> 0001-Sane-EOF-checking.patch, 0001-Test-case-for-AVRO-1238.patch, 
> avro-1238-good.avro, avro-1238-truncated.avro
>
>
> Currently in the C library, avro_file_reader_read_value will error out when 
> it hits the end of a file.
> I propose we make it detect when it has hit the end of file, and return -1.
> This means that we can differentiate between errors in opening the next block 
> versus actually having finished the file.
> I have attached the proposed changes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to