Skip to content

hashit -f hashdeep --mtime format hard to parse when commas present in filename(s) #20

@clach04

Description

@clach04

Files with at least one comma make parsing difficult when mtime is present. This is not an issue with hashdeep/md5deep as there is no mtime option and so processing the first three commas is reasonable.

With hashit, it's difficult to know when mtime has been hit or not. I'm not sure what the best (or least-worse) options/alternatives are.:"

  1. Having mtime before filesize would be safer but not compatible with hashdeep.
  2. Other idea would be to use quote delimited CSV which seems like a hassle.
  3. A crazy idea would be to have mtime in a specially formatted comment on the line below

Demo:

C:\tmp\tempty>dir
 Volume in drive C is Windows
 Volume Serial Number is 76A4-966B

 Directory of C:\tmp\tempty

11/26/2025  11:43 AM    <DIR>          .
11/26/2025  11:29 AM    <DIR>          ..
11/26/2025  11:43 AM                13 comma,file
11/26/2025  11:29 AM                 8 hello
               2 File(s)             21 bytes
               2 Dir(s)  1,409,346,256,896 bytes free

C:\tmp\tempty>C:\programs\md5deep-4.4\hashdeep64.exe  -l -r .
%%%% HASHDEEP-1.0
%%%% size,md5,sha256,filename
## Invoked from: C:\tmp\tempty
## C:\tmp\tempty> C:\programs\md5deep-4.4\hashdeep64.exe -l -r .
##
13,33b461ca4c511ed6b6285e6007321bcf,413f863bcb84caf0d83e46ea04d8845e675159c8db908cf3c4fd50069e3264ca,.\comma,file
8,6dd4566eb245627b49f3abb7e4502dd6,f873eef4f852e335da367d76ce7f1973c15b8ffebf532b064df4bc691cd51a87,.\hello

C:\tmp\tempty>hashit -f hashdeep --mtime
%%%% HASHDEEP-1.0
%%%% size,md5,sha256,filename,mtime
## Invoked from: C:\tmp\tempty
## $ hashit -f hashdeep --mtime
##
13,33b461ca4c511ed6b6285e6007321bcf,413f863bcb84caf0d83e46ea04d8845e675159c8db908cf3c4fd50069e3264ca,comma,file,2025-11-26 11:43:23
8,6dd4566eb245627b49f3abb7e4502dd6,f873eef4f852e335da367d76ce7f1973c15b8ffebf532b064df4bc691cd51a87,hello,2025-11-26 11:29:54

On windows colon ":" is not a valid character in filenames (I can;t recall right this second about other platforms/filesystems) so this might be a possible parsing hint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions