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

[Feature Request]: Can you provide a method for setting the file time #184

Open
1 task done
psvajaz opened this issue Dec 28, 2023 · 1 comment
Open
1 task done
Assignees

Comments

@psvajaz
Copy link

psvajaz commented Dec 28, 2023

Feature description

I hope that during compression, the save creation and access times can be set like FM, and during decompression, if a file in the compressed package has save creation and access times, corresponding event modifications can be made to the output file. I see that your code only determines the modification time of the file.
image

Additional context

No response

Code of Conduct

@rikyoz
Copy link
Owner

rikyoz commented Dec 28, 2023

Hi!

I hope that during compression, the save creation and access times can be set like FM

Creation and access times should already be stored in the output archive during compression. Unlike FM, though, this is not optional, as bit7z will always store them.

I'll evaluate an API to optionally turn off storing such metadata. The main problem is that those metadata are not "cross-platform", as many filesystems and Unix OSes don't have them.

during decompression, if a file in the compressed package has save creation and access times, corresponding event modifications can be made to the output file. I see that your code only determines the modification time of the file.

Yeah, I'll fix this, possibly in a hotfix release v4.0.6.
The main reason for the issue is that the modification time is the only "cross-platform" time metadata, so the fix will use the Windows API to restore the other time metadata.

Also, making this optional might require some thinking in the API, as for the compression case.

How to use the - ssp switch, which was added in the 7-zip version of 20.02

As for the -ssp switch, this must be implemented on the bit7z side; 7-zip DLLs don't accept it (as far as I know).
Unfortunately, implementing this feature will not be easy, as bit7z currently uses C++'s std::fstream for file IO, while accessing files without modifying the access time is possible only via WinAPI low-level file IO.
I found some possible workaround, but it will probably not be clean, so I'll check whether there are better options.

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