Skip to content

Output Path Tokens

When specifying a ROM writing command you have to specify an --output <path> directory. igir has a few replaceable "tokens" that can be referenced in the --output <path> directory value. This can aid in sorting ROMs into a more complicated directory structure.

See output path tokens for other options that will further sort your ROMs into subdirectories.

For example, if you want to group all ROMs based on their region, you would specify:

igir copy extract ^
  --dat *.dat ^
  --input ROMs\ ^
  --output "ROMs-Sorted\{gameRegion}\"
igir copy extract \
  --dat *.dat \
  --input ROMs/ \
  --output "ROMs-Sorted/{gameRegion}/"
igir copy extract \
  --dat *.dat \
  --input ROMs/ \
  --output "ROMs-Sorted/{gameRegion}/"

This might result in an output structure such as:

ROMs-Sorted/
├── AUS
│   └── Pokemon Pinball (USA, Australia) (Rumble Version) (SGB Enhanced) (GB Compatible).gbc
├── EUR
│   ├── Pokemon - Blue Version (USA, Europe) (SGB Enhanced).gb
│   ├── Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb
│   └── Pokemon - Yellow Version - Special Pikachu Edition (USA, Europe) (CGB+SGB Enhanced).gb
└── USA
    ├── Pokemon - Blue Version (USA, Europe) (SGB Enhanced).gb
    ├── Pokemon - Red Version (USA, Europe) (SGB Enhanced).gb
    ├── Pokemon - Yellow Version - Special Pikachu Edition (USA, Europe) (CGB+SGB Enhanced).gb
    └── Pokemon Pinball (USA, Australia) (Rumble Version) (SGB Enhanced) (GB Compatible).gbc

Note

Tokens can resolve to multiple values for each ROM. For example, a ROM may have multiple regions or languages. This will result in the same ROM being written to multiple locations.

DAT information

When using DATs, you can make use of console & game information contained in them:

  • {datName} the matching DAT's name, similar to how the --dir-dat-name option works
  • {datDescription} the matching DAT's description, similar to how the --dir-dat-description option works
  • {gameRegion} each of the ROM's region(s) (e.g. USA, EUR, JPN, WORLD)
  • {gameLanguage} each of the ROM's language(s) (e.g. EN, ES, JA)

Game information

You can use some information about each game:

  • {gameType} the game's "type," one of: Aftermarket, Alpha, Bad, Beta, BIOS, Demo, Device, Fixed, Hacked, Homebrew, Overdump, Pending Dump, Pirated, Prototype, Retail (most games will be this), Sample, Test, Trained, Translated, Unlicensed

File information

You can use some information about the input and output file's name & location:

  • {inputDirname} the input file's dirname (full path minus file basename)
  • {outputBasename} the output file's basename, equivalent to {outputName}.{outputExt}
  • {outputName} the output file's filename without its extension
  • {outputExt} the output file's extension

Specific hardware

To help sort ROMs into unique file structures for popular frontends & hardware, igir offers a few specific tokens:

  • {adam} the 'Adam' image emulator's directory for the ROM
  • {batocera} the Batocera emulator's directory for the ROM
  • {es} the EmulationStation emulator's directory for the ROM
  • {funkeyos} the FunKey OS emulator's directory for the ROM
  • {minui} the MinUI emulator's directory for the ROM
  • {miyoocfw} the MiyooCFW emulator's directory for the ROM
  • {jelos} the JELOS emulator's directory for the ROM
  • {mister} the MiSTer FPGA core's directory for the ROM
  • {onion} the OnionOS / GarlicOS emulator's directory for the ROM
  • {pocket} the Analogue Pocket core's directory for the ROM
  • {retrodeck} the RetroDECK emulator's directory for the ROM
  • {twmenu} the TWiLightMenu++ emulator's directory for the ROM

Tip

See the igir --help message for the list of all replaceable tokens.