Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The perl "read" function can continue to read after EOF #4014

Open
p5pRT opened this issue May 21, 2001 · 1 comment
Open

The perl "read" function can continue to read after EOF #4014

p5pRT opened this issue May 21, 2001 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented May 21, 2001

Migrated from rt.perl.org#7024 (status was 'open')

Searchable as RT7024$

@p5pRT
Copy link
Author

p5pRT commented May 21, 2001

From mcba@phys.unsw.edu.au

This bug report refers to the latest perl found on Redhat 7.1 Intel Linux
systems.

The bug occurs when I try to read data from a CCD camera device driver
that I wrote. The driver returns 0 at end-of-file to signal that the image
has been completed, BUT if you then try to read again, it will return
EWOULDBLOCK since it assumes that you have re-opened the device and are
expecting a new image. The perl "read" function sometimes ignores the 0,
and appears to try reading from the device again.

Now, this is arguably a bug in my device driver (and I will fix it),
however, the fundamental point remains that the C "read" function returned
zero, indicating EOF, and the perl "read" function can ignore this. Perl
"read" seems to assume that if an EOF is returned once, then it should be
returned on subsequent reads.

Note that the perl "sysread" function works fine with my driver
(as do the usual UNIX utilities such as "cp" and "cat").

I hope that this bug report is useful. Sorry I didn't use "perlbug".

Best regards,
Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant