Skip to content

extmod/vfs_fat_file: Implement SEEK_CUR for non-zero offset.#697

Merged
tannewt merged 1 commit intoadafruit:masterfrom
jepler:issue501
Mar 23, 2018
Merged

extmod/vfs_fat_file: Implement SEEK_CUR for non-zero offset.#697
tannewt merged 1 commit intoadafruit:masterfrom
jepler:issue501

Conversation

@jepler
Copy link

@jepler jepler commented Mar 23, 2018

I noticed that this functionality was now added in uPy and cherry-picked the fix.

As far as testing goes, there is an added test case but unfortunately it looks like the related test is skipped during the unix and qemu builds. ☹️

Closes: #501

CPython doesn't allow SEEK_CUR with non-zero offset for files in text mode,
and uPy inherited this behaviour for both text and binary files.  It makes
sense to provide full support for SEEK_CUR of binary-mode files in uPy, and
to do this in a minimal way means also allowing to use SEEK_CUR with
non-zero offsets on text-mode files.  That seems to be a fair compromise.
@tannewt tannewt added this to the 3.0 milestone Mar 23, 2018
@tannewt tannewt self-requested a review March 23, 2018 21:47
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks!

@tannewt tannewt merged commit fa88446 into adafruit:master Mar 23, 2018
@jepler jepler deleted the issue501 branch August 2, 2018 01:23
@jepler jepler restored the issue501 branch August 2, 2018 01:23
@jepler jepler deleted the issue501 branch August 2, 2018 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

file.seek

3 participants