File: cs_163.html

package info (click to toggle)
crystalspace 0.94-20020412-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 62,276 kB
  • ctags: 52,843
  • sloc: cpp: 274,783; ansic: 6,608; perl: 6,276; objc: 3,952; asm: 2,942; python: 2,354; php: 542; pascal: 530; sh: 430; makefile: 370; awk: 193
file content (200 lines) | stat: -rw-r--r-- 9,391 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!-- 
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
 
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: VFS Configuration File</TITLE>

<META NAME="description" CONTENT="Crystal Space: VFS Configuration File">
<META NAME="keywords" CONTENT="Crystal Space: VFS Configuration File">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">

</HEAD>

<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC342"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_162.html#SEC341"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_164.html#SEC343"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_160.html#SEC339"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_161.html#SEC340"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_164.html#SEC343"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H3> 7.2.2 Configuration File (`<TT>vfs.cfg</TT>') </H3>
<!--docid::SEC342::-->
<P>

The main `<SAMP>VFS.Mount.</SAMP>' section describes the layout of the "virtual"
file system. Imagine a clean disk drive onto which you start to create
directories by making links to existing "real" directories and archive
(`<TT>.zip</TT>') files.  An archive is treated exactly like a subdirectory; you
even can link one "virtual directory" to several "real" paths and
archives; however if you write files they will be written to the first
directory or archive in list.
</P><P>

This section contains a list of virtual-to-real path mappings. The local name
of the keys in the `<SAMP>VFS.Mount.</SAMP>' section define the virtual directory,
and the values define the real paths, which can represent a list of
<EM>physical</EM> directories and ZIP archives.  The path lists should be
separated by commas (,), so commas cannot be used in directory names. This
should not be much of a restriction, but if it is for a particular
application, change `<SAMP>VFS_PATH_DIVIDER</SAMP>' macro in `<TT>vfs.cpp</TT>'.
</P><P>

The <CODE>VFS.Mount.</CODE> section usually makes heavy use of variable data since
most operating systems have different pathname semantics and syntax.  The
"common denominator" that VFS emulates is a Unix-like filesystem.  To
include the value of a variable in a VFS path use the
`<SAMP>$(<VAR>variable-name</VAR>)</SAMP>' construct.  In the case where
`<SAMP><VAR>variable-name</VAR></SAMP>' consists of a single letter, you can omit the
parentheses, as in <CODE>$<VAR>variable-name</VAR></CODE> (for example `<SAMP>$A</SAMP>').
</P><P>

Variables that are defined in the environment override those defined in this
file.  For example, the `<SAMP>$HOME</SAMP>' environment variable is set in all
Unixes, but is undefined in many other operating systems.  They can define
their own values for these variables in system-dependent sections, but if the
user defines the `<SAMP>$HOME</SAMP>' environment variable it will always override
the one from this file. You also can refer the variables in the following
way: `<SAMP>$(<VAR>var</VAR>:<VAR>expr</VAR>)</SAMP>' which means "use the contents of
`<SAMP><VAR>var</VAR></SAMP>' if `<SAMP><VAR>var</VAR></SAMP>' is set (usually in environment), or use
`<SAMP><VAR>expr</VAR></SAMP>' if not".  This can be used for more complex expressions,
for example:
</P><P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>$(HOME:$(HOMEDIR:$(HOMEPATH:/home)))
</pre></td></tr></table></P><P>

This expression means "take the value of the `<SAMP>$HOME</SAMP>' variable; if it is
not set, use the contents of `<SAMP>$HOMEDIR</SAMP>'; if it is also not set, use
`<SAMP>$HOMEPATH</SAMP>'; and if none are set, use the literal string `<SAMP>/home</SAMP>' as
the resulting value.
</P><P>

The VFS class defines a variable called `<SAMP>/</SAMP>' that contains the path
delimiter for the current operating system (i.e. `<SAMP>/</SAMP>' for Unix, `<SAMP>\</SAMP>'
for Windows/DOS, and `<SAMP>:</SAMP>' for Macintosh).  You reference this
variable by writing `<SAMP>$/</SAMP>' rather than using the "real-world" delimiters
`<SAMP>/</SAMP>', `<SAMP>\</SAMP>', or `<SAMP>:</SAMP>'.
</P><P>

The following is an example VFS configuration file.
</P><P>

Assume we wrote a game with three levels; the game is located on CD-ROM
and we want to be able to release patches in the future which will replace
several files from level archives (each level is presumed to be placed in a
separate ZIP archive on either CD-ROM or cached on the hard drive).
Additionally, we will add a link to user's home directory (something somewhat
vaguely defined on non-Unix platforms) so that game can store the user's
settings into the file `<TT>~/game.profile</TT>'.
</P><P>

Note that in this example many of the options in the real `<TT>vfs.cfg</TT>' are
omitted. So you should not take this example for your game, because one of the
libraries or plug-in modules you use may require a mapping that is not listed
here. This example is only intended to understand the concept:
</P><P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>; The following variables should be defined either in
; the environment or in system-dependent sections:
;
; $. - The current directory.
; $@ - The directory into which CS has been installed. This is
;      detected by iSystem::GetInstallPath().
; $/ - The native path separator character; this value is
;      supplied by the VFS manager, so you do not need to define
;      it here; you can do so, however, if you really want to.
; $CD - The path to CD-ROM.
; $HOME - user's home directory

; A common error is to omit the last $/ from directories.
; This is an error since VFS will treat any path not ending
; in $/ as an archive file name and not as a physical
; directory.

VFS.Mount.~ = $(HOME)$/
VFS.Mount.map1 =
  $.$/patches$/map1$/, $.$/cache$/map1.zip, $(CD)$/data$/map1.zip
VFS.Mount.map2 =
  $.$/patches$/map2$/, $.$/cache$/map2.zip, $(CD)$/data$/map2.zip
VFS.Mount.map3 =
  $.$/patches$/map3$/, $.$/cache$/map3.zip, $(CD)$/data$/map3.zip

; Platform aliases.  Aliases are always read first; VFS
; entries specific to each platform override those defined
; in the platform alias section.  For example, if your
; current platform is Solaris, VFS will look for the value
; of a variable first in the environment, then in
; VFS.Solaris., and finally in VFS.Unix. (as specified in
; section below).

; Unix-style filesystems
VFS.Alias.Solaris         = VFS.Unix
VFS.Alias.Linux           = VFS.Unix
VFS.Alias.BSD             = VFS.Unix
VFS.Alias.Irix            = VFS.Unix
VFS.Alias.NextStep        = VFS.Unix
VFS.Alias.OpenStep        = VFS.Unix
VFS.Alias.MacOS/X Server  = VFS.Unix
VFS.Alias.BeOS            = VFS.Unix

; CP/M-style filesystems
VFS.Alias.DOS             = VFS.CP/M
VFS.Alias.OS/2            = VFS.CP/M
VFS.Alias.Win32           = VFS.CP/M

; strange key names follow:
; VFS.Unix.. means key '.' in section VFS.Unix.*
; VFS.Unix... means key '..' in section VFS.Unix.*
VFS.Unix.. = .
VFS.Unix... = ..
VFS.Unix.CD = /mnt/cdrom

VFS.CP/M.. = .
VFS.CP/M... = ..
VFS.CP/M.HOME = $(HOMEDIR:$(HOMEPATH:.))
VFS.CP/M.CD = x:

VFS.Macintosh.. = 
VFS.Macintosh... = ..
VFS.Macintosh.HOME = 
</pre></td></tr></table><A NAME="Graphics Drivers"></A>
<HR SIZE=1>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_162.html#SEC341"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_164.html#SEC343"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_160.html#SEC339"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_161.html#SEC340"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_164.html#SEC343"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>  
<FONT SIZE="-1">
This document was generated

using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>

</BODY>
</HTML>