Skip to content

Commit

Permalink
Merge pull request #160 from ararslan/aa/readavailable
Browse files Browse the repository at this point in the history
Add `readavailable(::FileBuffer)`
  • Loading branch information
rofinn authored Mar 17, 2022
2 parents 534b301 + 355420f commit 2cb4068
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FilePathsBase"
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
authors = ["Rory Finnegan"]
version = "0.9.17"
version = "0.9.18"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
1 change: 1 addition & 0 deletions src/buffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ end
Base.isopen(buffer::FileBuffer) = isopen(buffer.io)
Base.isreadable(buffer::FileBuffer) = buffer.read
Base.iswritable(buffer::FileBuffer) = buffer.write
Base.readavailable(buffer::FileBuffer) = read(buffer)
Base.seek(buffer::FileBuffer, n::Integer) = (_read(buffer); seek(buffer.io, n))
Base.skip(buffer::FileBuffer, n::Integer) = (_read(buffer); skip(buffer.io, n))
Base.seekstart(buffer::FileBuffer) = seekstart(buffer.io)
Expand Down
2 changes: 2 additions & 0 deletions test/buffer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ using FilePathsBase: FileBuffer
close(io)
end

@test readavailable(FileBuffer(p)) == readavailable(IOBuffer(read(p)))

# issue #126: data on first read
mktemp(SystemPath) do p, _
write(p, "testing")
Expand Down

2 comments on commit 2cb4068

@rofinn
Copy link
Owner Author

@rofinn rofinn commented on 2cb4068 Mar 17, 2022

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/56799

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.18 -m "<description of version>" 2cb4068fcf94f5671039ae8a200d3f21e7a52584
git push origin v0.9.18

Please sign in to comment.