Crystal Space: 4.7.1 Details

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 4.7.1 Details

To make difference between ZIP archives and physical disk directories VFS uses a simple convention: directories end with a path separator character (``$/'`) while archives do not. ``$/'` is a special configuration file variable which represents the path separator on any particular platform (see section Configuration File (``vfs.cfg'`)). For example ``$/data'` refers to an archive, while ``$/data$/'` refers to an actual directory named ``data'`. Failure to understand this distinction is often the major cause of errors; so if you're getting unexpected results check in the first place if directories have trailing path separators.

There are several differences between filesystems between operating systems that you should always keep in mind because VFS doesn't hide these details from you. To avoid inconsistencies between different file systems you should follow this list of guidelines:

- Choose filenames that are well suited for all operating systems you are targeting. As of today DOS has the most restricted rules for naming files (ASCII7 characters except ``?'`, ``*'`, ``+'`, and space, and with only one dot per filename). The part of VFS that is located in archives support virtually any filenames, so if you are sure that you will never have to place some file on a "real" filesystem, you can give it any name you desire.
- Different platforms use different filename comparison criteria. On Unix and MacOS/X UFS filesystems, filenames are case-sensitive, while on Windows, DOS, and Macintosh HFS filesystems, they are case-insensitive. To avoid problems always refer to files by their exact names. For example, if you have a file on VFS called ``GaMe.DaT'` you should open it exactly as ``GaMe.DaT'` and not as ``game.dat'` or ``GAME.DAT'`. On DOS, the file will appear to be entirely upper-case ``GAME.DAT'`, but you should still use the correct name, ``GaMe.DaT'`, when opening it.
- Keep in mind that Unix can delete files which are actively open, whereas Windows, DOS, and possibly other platforms can not. Therefore, you should avoid deleting open files. (Technical Note: Actually, this should work for files which are located in archives but is not advisable to do so, because in general, program code will not know if a file resides within an archive or within the physical filesystem. Furthermore, deleting open files from an archive not been tested.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.