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

Base.read method partially supported #280

Open
etibarg opened this issue Feb 3, 2023 · 0 comments
Open

Base.read method partially supported #280

etibarg opened this issue Feb 3, 2023 · 0 comments

Comments

@etibarg
Copy link

etibarg commented Feb 3, 2023

Hi,

Following logic from #279, in order to add "transparency" in the use of S3Path, I ended up coding the following:

using AWSS3: S3Path
function Base.read(fp::S3Path, nb::Integer)
    read(fp; byte_range=1:nb)
end

... in order to match:

Base.read(s::IOStream, nb::Integer; all=true)

(in a simplified version)

Granted, the Base version takes an IOStream. But considering the existing read(fp::S3Path; byte_range=1:nb) method provided, the expected behavior is not far-fecthed.
This is very convient in order not to download the whole file (e.g. to access some metadata), while not caring of the actual path type.

Would it be possible to implement it?

Rgds,

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