static bool File.Exists(string filename)
Checks if the specified file exists on the file system.
This command supports the special tag $SAVEGAMEDIR$, which allows
you to access files in the save game directory. This is especially important with
the move to Windows Vista, in which you may not have access to the main game folder.
NOTE: This is a static function, therefore you don't need an open File pointer
to use it. See the example below.
Example:
if (!File.Exists("temp.tmp"))
{
File *output = File.Open("temp.tmp", eFileWrite);
output.WriteString("some text");
output.Close();
}
will create the file "temp.tmp" if it doesn't exist
Compatibility: Supported by AGS 3.0.1 and later versions.
See Also: File.Delete, File.Open
|