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

Update zip with zip64, extended timestamps and UID/GID handling #8537

Merged
merged 21 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d71b321
zip: Remove dead code and move some functions
garazdawi May 30, 2024
84eed7e
zip: Fix dos date time convertion of seconds
garazdawi May 30, 2024
97a1eae
zip: Fix zip:foldl to not use prim_zip
garazdawi May 30, 2024
30988f6
zip: The mod time should be in local_time
garazdawi May 30, 2024
8d537f5
zip: List dir now returns directories
garazdawi May 30, 2024
8043394
zip: Correctly encode Unix external attributes in zip files
garazdawi May 30, 2024
d6c4e1f
zip: Write external attributes to disk when creating files
garazdawi May 30, 2024
cbfeda2
zip: Polish test suite
garazdawi May 30, 2024
438b2dd
zip: Add basic timestamp test
garazdawi May 30, 2024
f37af5d
zip: Add test for external attributes mode handling
garazdawi May 30, 2024
92ec6f1
zip: Implement extended timestamps
garazdawi May 30, 2024
665b467
zip: Add support for UNIX3 (aka uid and gid) extra attribute
garazdawi May 31, 2024
dac9126
zip: Implement zip64 support
garazdawi May 31, 2024
bc9581d
zip: Fix zip STORE to work with > 4GB files on Windows
garazdawi Jun 20, 2024
7e9f3d1
zip: Increase size printout for zip:tt to suite zip64
garazdawi May 30, 2024
d7542b9
zip: zlib can already have been closed
garazdawi May 31, 2024
fc1dc59
zip: Polish documentation
garazdawi May 31, 2024
17d19f5
zip: Add skip_directories option
garazdawi May 31, 2024
134a442
zip: Do not fallback to dostime for ctime
garazdawi Jun 26, 2024
2e2996f
zip: Cleanup testcases to be simpler and more stable
garazdawi Jun 3, 2024
efc2de2
erts: Polish open_port env opts documentation
garazdawi Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified erts/preloaded/ebin/prim_zip.beam
Binary file not shown.
23 changes: 10 additions & 13 deletions erts/preloaded/src/erlang.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7128,20 +7128,17 @@ follows:
`{spawn_executable, FileName}`. The external program starts using `Dir` as its
working directory. `Dir` must be a string.

- **`{env, Env}`** - Types:
  `Name = ``t:os:env_var_name/0`
  `Val = ``t:os:env_var_value/0`` | false`
  `Env = [{Name, Val}]`

Only valid for `{spawn, Command}`, and `{spawn_executable, FileName}`. The
environment of the started process is extended using the environment
- **`{env, Env}`** - Only valid for `{spawn, Command}`, and `{spawn_executable, FileName}`.
The environment of the started process is extended using the environment
specifications in `Env`.

`Env` is to be a list of tuples `{Name, Val}`, where `Name` is the name of an
environment variable, and `Val` is the value it is to have in the spawned port
process. Both `Name` and `Val` must be strings. The one exception is `Val`
being the atom `false` (in analogy with `os:getenv/1`), which removes the
environment variable.
`Env` is to be a list of tuples `{Name, Val}`, where `Name` is a `t:os:env_var_name/0`
representing the name of an environment variable, and `Val` is a `t:os:env_var_name/0`
representing the value it is to have in the spawned port process. Both `Name` and `Val` must
be strings.

If `Val` is set to the atom `false` or the empty string (that is `""` or `[]`), open_port
will consider those variables unset just as if `os:unsetenv/1` had been called.

For information about encoding requirements, see documentation of the types
for `Name` and `Val`.
Expand Down Expand Up @@ -7327,7 +7324,7 @@ by passing command-line flag [`+Q`](erl_cmd.md#max_ports) to [erl](erl_cmd.md).
| stream
| {line, L :: non_neg_integer()}
| {cd, Dir :: string() | binary()}
| {env, Env :: [{Name :: os:env_var_name(), Val :: os:env_var_value() | false}]}
| {env, Env :: [{Name :: os:env_var_name(), Val :: os:env_var_value() | [] | false}]}
| {args, [string() | binary()]}
| {arg0, string() | binary()}
| exit_status
Expand Down
2 changes: 1 addition & 1 deletion erts/preloaded/src/prim_zip.erl
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ dos_date_time_to_datetime(DosDate, DosTime) ->
<<Hour:5, Min:6, Sec:5>> = <<DosTime:16>>,
<<YearFrom1980:7, Month:4, Day:5>> = <<DosDate:16>>,
{{YearFrom1980+1980, Month, Day},
{Hour, Min, Sec}}.
{Hour, Min, Sec * 2}}.

cd_file_header_from_bin(<<VersionMadeBy:16/little,
VersionNeeded:16/little,
Expand Down
Loading
Loading