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

FILE-POSITION reports wrong values #181

Open
jlahd opened this issue Jan 3, 2019 · 0 comments
Open

FILE-POSITION reports wrong values #181

jlahd opened this issue Jan 3, 2019 · 0 comments

Comments

@jlahd
Copy link

jlahd commented Jan 3, 2019

For streams with non-byte ELEMENT-TYPE, FILE-POSITION reports wrong values after the I/O buffer is advanced:

? (with-open-file (f "/dev/zero" :direction :input :element-type '(unsigned-byte 32))
(loop for i below 2000
do (read-byte f)
collect (file-position f)))
(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54\ 55 56 57 58 59 60 61 62 63 16 17 18 19 20 21 22 23 ...

This happens because element size is not properly accounted for in input-file-ioblock-advance. Patch proposal attached.

file-position-patch.zip


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

jlahd added a commit to jlahd/ccl that referenced this issue Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant