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

Entry information #75

Closed
TethysSvensson opened this issue Nov 3, 2021 · 10 comments
Closed

Entry information #75

TethysSvensson opened this issue Nov 3, 2021 · 10 comments
Labels
enhancement New feature or request

Comments

@TethysSvensson
Copy link
Contributor

It would be nice to be able to get information about entries, e.g. file type or the creation time.

@otavio
Copy link
Member

otavio commented Nov 3, 2021

Great. Do you have an idea for the API?

@Jonathas-Conceicao
Copy link
Member

Libarchive does provide a few functions for getting information about entries. A think they would generally come in hand when iterating over them in the API we currently provide.

It would need some internal code change, but I think it would be useful to have them accesable as methods over the iterator::ArchiveContents.

@Jonathas-Conceicao Jonathas-Conceicao added the enhancement New feature or request label Nov 3, 2021
@TethysSvensson
Copy link
Contributor Author

TethysSvensson commented Nov 3, 2021

I've implemented a hack to support my usecase here: https://github.com/TethysSvensson/compress-tools-rs/commit/d52e0fd4082d26ce86f8847290651aa4239a8c1a .

I don't think this is a particularly good implementation or API, but as I said it does support my usecase.

@otavio
Copy link
Member

otavio commented Jul 24, 2022

@TethysSvensson, the proposed API isn't bad. I think the stat could use a Rust type for it. Did you improve it?

@TethysSvensson
Copy link
Contributor Author

@otavio No, I'm still using my branch from November.

@otavio
Copy link
Member

otavio commented Jul 24, 2022

Please rebase and prepare a PR.

@otavio
Copy link
Member

otavio commented Jul 24, 2022

@otavio
Copy link
Member

otavio commented Jul 24, 2022

Once you prepare an initial PR, I'll try to rework it.

@TethysSvensson
Copy link
Contributor Author

@TethysSvensson, https://docs.rs/nix/latest/nix/sys/stat/struct.FileStat.html could be an option.

The FileStat struct in the nix crate is simply a re-export of the stat struct from the libc crate.

@otavio
Copy link
Member

otavio commented Aug 2, 2022

Fixed in f654d6d.

@otavio otavio closed this as completed Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants