Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Preservation of file timestamps #21

@mzpqnxow

Description

@mzpqnxow

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:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions