Skip to content

Commit

Permalink
BREAKING: Remove zip_open_filereader (#43)
Browse files Browse the repository at this point in the history
* remove ZipFileReader and zip_open_filereader

* Only test huge zip files on 64 bit systems.

* Fix comment typo
  • Loading branch information
nhz2 authored Apr 1, 2024
1 parent 29e2966 commit 8754cef
Show file tree
Hide file tree
Showing 12 changed files with 174 additions and 531 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ZipArchives"
uuid = "49080126-0e18-4c2a-b176-c102e4b3760c"
authors = ["nhz2 <[email protected]>"]
version = "1.1.3"
version = "2.0.0"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Archives can be read from any `AbstractVector{UInt8}` containing the data of a z
For example if you download this repo as a ".zip" from github https://github.com/JuliaIO/ZipArchives.jl/archive/refs/heads/main.zip you can read this README in julia.

```julia
using ZipArchives: ZipBufferReader, zip_names, zip_readentry
using ZipArchives: ZipReader, zip_names, zip_readentry
using Downloads: download
data = take!(download("https://github.com/JuliaIO/ZipArchives.jl/archive/refs/heads/main.zip", IOBuffer()));
archive = ZipBufferReader(data)
archive = ZipReader(data)
```

Check the names in the archive.
Expand Down Expand Up @@ -119,6 +119,7 @@ ZipArchives currently has the following limitations compared to ZipFile:
1. No way to specify the modification time, times are set to zero dos time.
2. No `flush` function for `ZipWriter`. `close` and `zip_append_archive` can be used instead.
3. Requires at least Julia 1.6.
4. No way to read an archive from an `IOStream`, `mmap` can be used instead.



Expand Down
9 changes: 4 additions & 5 deletions src/ZipArchives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ For example if you download this repo as a ".zip" from github https://github.com
you can read the README in julia.
```julia
using ZipArchives: ZipBufferReader, zip_names, zip_readentry
using ZipArchives: ZipReader, zip_names, zip_readentry
using Downloads: download
data = take!(download("https://github.com/JuliaIO/ZipArchives.jl/archive/refs/heads/main.zip", IOBuffer()));
archive = ZipBufferReader(data)
archive = ZipReader(data)
```
```julia
Expand Down Expand Up @@ -58,8 +58,7 @@ include("filename-checks.jl")
include("types.jl")

include("reader.jl")
export ZipFileReader
export zip_open_filereader
export ZipReader
export ZipBufferReader

export zip_crc32
Expand Down Expand Up @@ -113,7 +112,7 @@ export zip_mkdir
end
end
zipdata = take!(io)
r = ZipBufferReader(zipdata)
r = ZipReader(zipdata)
zip_readentry(r, 1)
end
end
Expand Down
Loading

2 comments on commit 8754cef

@nhz2
Copy link
Member Author

@nhz2 nhz2 commented on 8754cef Apr 1, 2024

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Breaking changes

  • Removed ZipFileReader and zip_open_filereader. Please use read or Mmap.mmap to read a file with ZipReader AKA ZipBufferReader.

@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/104038

Tagging

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 v2.0.0 -m "<description of version>" 8754cef2c6eed09b460b4f5d6e50058fb95b8679
git push origin v2.0.0

Please sign in to comment.