Tao.PhysFs SDK Documentation

Fs.PHYSFS_setSaneConfig Method 

Set up sane, default paths.

[Visual Basic]
Public Shared Function PHYSFS_setSaneConfig( _
   ByVal organization As String, _
   ByVal appName As String, _
   ByVal archiveExt As String, _
   ByVal includeCdRoms As Integer, _
   ByVal archivesFirst As Integer _
) As Integer
[C#]
public static int PHYSFS_setSaneConfig(
   string organization,
   string appName,
   string archiveExt,
   int includeCdRoms,
   int archivesFirst
);

Parameters

organization
Name of your company/group/etc to be used as a dirname, so keep it small, and no-frills.
appName
Program-specific name of your program, to separate it from other programs using PhysicsFS.
archiveExt
File extension used by your program to specify an archive. For example, Quake 3 uses "pk3", even though they are just zipfiles. Specify NULL to not dig out archives automatically. Do not specify the '.' char; If you want to look for ZIP files, specify "ZIP" and not ".ZIP" ... the archive search is case-insensitive.
includeCdRoms
Non-zero to include CD-ROMs in the search path, and (if (archiveExt) != NULL) search them for archives. This may cause a significant amount of blocking while discs are accessed, and if there are no discs in the drive (or even not mounted on Unix systems), then they may not be made available anyhow. You may want to specify zero and handle the disc setup yourself.
archivesFirst
Non-zero to prepend the archives to the search path. Zero to append them. Ignored if !(archiveExt).

Return Value

nonzero on success, zero on error. Specifics of the error can be gleaned from PHYSFS_getLastError().

Remarks

Helper function.

The write dir will be set to "userdir/.organization/appName", which is created if it doesn't exist.

The above is sufficient to make sure your program's configuration directory is separated from other clutter, and platform-independent. The period before "mygame" even hides the directory on Unix systems.

The search path will be: * The Write Dir (created if it doesn't exist) * The Base Dir (PHYSFS_getBaseDir()) * All found CD-ROM dirs (optionally)

These directories are then searched for files ending with the extension (archiveExt), which, if they are valid and supported archives, will also be added to the search path. If you specified "PKG" for (archiveExt), and there's a file named data.PKG in the base dir, it'll be checked. Archives can either be appended or prepended to the search path in alphabetical order, regardless of which directories they were found in.

All of this can be accomplished from the application, but this just does it all for you. Feel free to add more to the search path manually, too.

See Also

Fs Class | Tao.PhysFs Namespace