Resources | Resources |



File path references

Brew MP allows the following types of file path references:

  • Self: relative to the current module (for example, fs:/~/HighScores.dat)
  • Absolute: starts at the root of the file system (for example, fs:/mod/Tetris/HighScores.dat)
  • Module/ClassID-relative: includes the ClassID of the module that contains the path (for example, fs:/~0xNNNNN/HighScores.dat where NNNNNNN is a ClassID)

Self-relative and ClassID-relative paths are backward compatible, regardless of where the module is installed. The Brew MP file system code properly resolves the pathname.

Absolute paths do not necessarily take into account the possibility that the module was installed in a location other than in fs:/mod or that the application is on an MMC. It is recommended that you write new applications and change existing applications from absolute paths to self- or ClassID-relative paths, and read File path references).

File path reference example

If the MediaStore module is installed in fs:/UserMods, absolute references to it, such as the following, will fail:


Modules should be referenced by ClassID instead of absolute references. You must know the ClassID of the module to which you are referring. The following reference, which uses the module's ClassID, would work correctly (replace 0x0153c565 with the appropriate ClassID in your code):


To replace absolute references with ClassID references, you can find most references by searching your code for the one of the following strings:

  • fs:/mif
  • fs:/mod

While this will catch most references, there is a possibility that the path is constructed in some other way. It is recommended that you:

  • Review all code that opens files. Path names can reside in initialization, configuration, or resource files.
  • Search every file that makes up the source to an application, including binary files.

Use of absolute path references

This section provides information on the implications of absolute path references on the following:

  • Applications and extensions
  • System applications and extensions
  • Applications on memory cards

  • Applications and extensions

    Even with backwards compatibility, it is recommended that you write new code without absolute paths and fix existing code to remove absolute paths for all applications, which will accomplish the following:

    • Ensure that the application can run off a memory card.
    • Ensure that the application is downloadable by download systems other than the BDS.
    • Ensure that the application can be installed in other collections such as UserMods.
    • Be prepared in case referenced modules are moved.

  • System applications and extensions

    A system application is usually written by the OEM, or is part of Brew MP or the AMSS itself. It could also be an important third-party application that is integrated by the OEM as part of the factory load. Although it is technically possible to have these applications installed in fs:/mif and fs:/mod, the preference is to separate them from user downloaded and installed applications by putting them elsewhere. It is recommended that you check system modules for path dependency on other system modules that might have moved or might be moving since there is a general effort to move these modules.

    For system modules, the following is recommended:

    • For all applications or extensions, fix the absolute path references.
    • Accelerate the fix if it is determined that the particular module depends on another system module known to be moving.
    • Move system modules to fs:/sys/mod for better organization. This should be done for anything considered a system module that is loaded at the factory, including const, statically linked, or fully dynamic modules.

  • Applications on memory cards

    Note: For an application to run from a memory card, it must be able run from a location other than fs:/mif and fs:/mod.

    If an application is to be installed on and run from a memory card, you must fix its absolute paths. It is critical that self-references are not absolute. If those are not fixed, the application is likely to fail in some way, possibly a large failure. It is recommended that you fix all path references, as well as any self-references.