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

Don't read past end of file #53

Open
adriangb opened this issue May 6, 2022 · 1 comment
Open

Don't read past end of file #53

adriangb opened this issue May 6, 2022 · 1 comment
Labels
bug something does not work

Comments

@adriangb
Copy link

adriangb commented May 6, 2022

I'm dealing with an SFTP server that errors out if you send a read() for more bytes than the file has. Not sure if this is a common thing or my server is just not following specs (wouldn't surprise me).

I solved this by manually tracking the filesize and bytes read, but I'm wondering if there'd be any cons to just having this in the package?

Two options would be:

  • Do what s3fs does and download into a temp file so that users won't encounter discrepancies between real filesystems and sftp
  • Emulate reading beyond the last byte without actually sending requests
@althonos
Copy link
Owner

Hi @adriangb, sorry for the long delay. I'd be fine with having the filesize tracking inside the library, so if you feel like submitting a PR I'd happily take it.

@althonos althonos added the bug something does not work label Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something does not work
Projects
None yet
Development

No branches or pull requests

2 participants