spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * File functions and properties

Exists

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


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.