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

RAR extract file information #420

Open
DylanZhu2021 opened this issue Aug 22, 2024 · 2 comments
Open

RAR extract file information #420

DylanZhu2021 opened this issue Aug 22, 2024 · 2 comments

Comments

@DylanZhu2021
Copy link

DylanZhu2021 commented Aug 22, 2024

Use the code as follow to get file information such as file mod tiinme in .rar:

f, err := os.Open(realpath)

if err != nil {
	return nil, err
}

rar := archiver.Rar{}

handleFun := func(ctx context.Context, f archiver.File) error {
	fmt.Println(f.ModTime())
}

err = rar.Extract(context.Background(), f, nil, handleFun)

the file time is null. However,the file such as zip,tar get right mod time.

Someone can tell me why. Thanks.

@mholt
Copy link
Owner

mholt commented Aug 22, 2024

Can you provide an archive that exhibits this behavior? I don't have a rar file handy that does this.

@DylanZhu2021
Copy link
Author

Can you provide an archive that exhibits this behavior? I don't have a rar file handy that does this.

There is a test file for rar in test.zip, you can dearchive this and get the rar file. Thanks.
test.zip

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

2 participants