Skip to content

Writing Zip Archives

Igir supports creating .zip archives with the igir zip command.

Note

It is intentional that Igir only supports .zip archives right now.

.zip archives store CRC32 information in their "central directory" which helps drastically speed up Igir's file scanning, and they are easy to create without proprietary tools (e.g. 7-Zip, Rar).

See the reading archives page for more information on archive formats and their capabilities.

Example: zipping a ROM collection

One aspect of organizing a ROM collection is to ensure a consistent archive format. You can ensure all ROMs in a collection are in a .zip archive like this:

igir move zip --dat "*.dat" --input "ROMs\" --output "ROMs\"
igir move zip --dat "*.dat" --input "ROMs/" --output "ROMs/"
igir move zip --dat "*.dat" --input "ROMs/" --output "ROMs/"

Excluding files from zipping

There are multiple reasons why you might need some files to be extracted and not in a .zip archive:

  • Most emulators don't support archived BIOS files
  • Some emulators don't support archived disc formats such as .iso or .bin/.cue
  • It may not make sense to compress already compressed formats such as .chd, .cso, and .rvz

You can exclude files from being zipped with the --zip-exclude <glob> option. The "glob" value for this option will be matched against the file's intended output location (as opposed to an input file's location).

You can exclude some disc images like this:

igir copy zip ^
  --dat "*.dat" ^
  --input "ROMs\" ^
  --output "ROMs-Sorted\" ^
  --zip-exclude "**/*.{iso,bin,cue,chd}"
igir copy zip \
  --dat "*.dat" \
  --input "ROMs/" \
  --output "ROMs-Sorted/" \
  --zip-exclude "**/*.{iso,bin,cue,chd}"
igir copy zip \
  --dat "*.dat" \
  --input "ROMs/" \
  --output "ROMs-Sorted/" \
  --zip-exclude "**/*.{iso,bin,cue,chd}"

You can exclude some BIOS files like this:

igir copy zip ^
  --dat "*.dat" ^
  --input "ROMs\" ^
  --output "ROMs-Sorted\" ^
  --zip-exclude "**/*[BIOS]*"
igir copy zip \
  --dat "*.dat" \
  --input "ROMs/" \
  --output "ROMs-Sorted/" \
  --zip-exclude "**/*[BIOS]*"
igir copy zip \
  --dat "*.dat" \
  --input "ROMs/" \
  --output "ROMs-Sorted/" \
  --zip-exclude "**/*[BIOS]*"

Tip

globster.xyz is a great website to test various glob patterns.