Skip to content

Conversation

@sjoblomj
Copy link
Contributor

This allows power users to see the file properties they are interested in, when listing details in MPQ files. The default - if no properties are specified - will still print the same as before.

This PR also makes testing easier since it allows to check file content from tests without having to fiddle with dates which are timezone dependent.

Comment on lines +205 to +217
- `hash-index` - Index in the hash table where the file entry is.
- `name-hash1` - The first hash of the file name.
- `name-hash2` - The second hash of the file name.
- `name-hash3` - 64-bit Jenkins hash of the file name, used for searching in the HET table.
- `locale` - Locale info of the file.
- `file-index` - Index in the file table of the file.
- `byte-offset` - Offset of the file in the MPQ, relative to the MPQ header.
- `file-time` - Timestamp of the file.
- `file-size` - Uncompressed file size of the file, in bytes.
- `compressed-size` - Compressed file size of the file, in bytes.
- `encryption-key` - Encryption key for the file.
- `encryption-key-raw` - Encryption key for the file.
- `flags` - File flags for the file within MPQ:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The names and descriptions are from here: http://zezula.net/en/mpq/stormlib/sfilegetfileinfo.html

Comment on lines +218 to +230
* `i`: File is Imploded (By PKWARE Data Compression Library).
* `c`: File is Compressed (By any of multiple methods).
* `e`: File is Encrypted.
* `2`: File is Encrypted with key v2.
* `p`: File is a Patch file.
* `u`: File is stored as a single Unit, rather than split into sectors.
* `d`: File is a Deletion marker. Used in MPQ patches, indicating that the file no longer exists.
* `r`: File has Sector CRC checksums for each sector. This is ignored if the file is not compressed or imploded.
* `s`: Present on STANDARD.SNP\(signature).
* `x`: File exists; this is reset if the file is deleted.
* `m`: Mask for a file being compressed.
* `n`: Use default flags for internal files.
* `f`: Fix key; This is obsolete.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +7 to +12
"""
Test MPQ file listing with no parameters.
This test checks:
- That running the list command with no parameters renders a list of the files inside, with no details.
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding a description to a previous test, for consistency.

Comment on lines +139 to +150
"""
Test MPQ file listing of MPQ with weak signature.
This test checks:
- That handling MPQs with weak signatures generates the expected output.
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just adding a description to a previous test, for consistency.

@sjoblomj sjoblomj force-pushed the list-user-requested-properties branch from 23c927d to c3e7967 Compare October 22, 2025 07:34
@thomaslaurenson
Copy link
Collaborator

Love this addition - will test with some of my archives and report back.

@sjoblomj
Copy link
Contributor Author

Love this addition - will test with some of my archives and report back.

Glad to hear you like it. Please do test. I'm a little unsure about the correct number of characters to use for some of these parameters. I think I got it right, but it could need slight tweaking.

@sjoblomj
Copy link
Contributor Author

This was merged as part of #118.

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

Successfully merging this pull request may close these issues.

2 participants