-
Notifications
You must be signed in to change notification settings - Fork 30
Preservation of file timestamps #21
Description
Hello, thanks for accepting the job of maintaining the project
As you probably know, cpio files are handled as "special", using the plugins.cpio module rather than the configuration file:
binwalk/src/binwalk/plugins/cpio.py
Line 47 in 3dd13d7
| result = subprocess.call(['cpio', '-d', '-i', '--no-absolute-filenames'], |
The extraction command is straightforward, but I've found the need to make a slight modification, specifically adding -m/--preserve-modification-time
I use that because it makes it easier to quickly get an idea of how old the files in the archive are
It's often especially helpful if you have, for example, a bundle of blobs with non-descriptive names, and you would like to identify the most recent
I don't think the current behavior is a bug and am therefore not sending a PR with this, unless there's some consensus about whether it's desirable or not
A couple of downsides of making this change that I can think of:
- It may break someone's automated workflow, if said workflow depends on the mtimes being set to the time of unpacking (current behavior) rather than a time closer to the time of packing
- The modification times in an archive may not always be correct or meaningful anyway, which could cause confusion
In my case, it's proven really useful, though
Thoughts on making this change (or accepting a very small PR for it)?
Thx
EDIT: I considered at one time having a runtime option in binwalk cli to influence this behavior for all archive types that supported timestamps, but ultimately decided it wasn't worth the effort for my one-off use-case, where I only needed it for cpio