OpenRawFile
From Spheriki
Creates a new RawFile object, through which an existing file can be accessed, or a new one created.
Contents |
Usage
- filename String. Path to the file; defaults to the
other/directory, but follows the path rules of the other file functions such as LoadFont() (see notes). If writeable is false or omitted, this file must exist or an error will be raised. - writeable boolean, defaults to false. If true, allows write operations to work (i.e. RawFile.write()), but will overwrite the existing contents of the file. If false or unsupplied, the file must exist beforehand.
Examples
See the examples for RawFile.getSize().
Notes
- To load files in subdirectories other than
other/, use one of the following prefixes, followed by the desired path:-
~/to load from the game's base directory. This allows for better organisation. -
/common/to load fromSphere/common/, a directory that can be shared by all games.
-
- For simpler, managed storage and retrieval of values, consider using the Sphere File object instead.
See also
- LoadFont()