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

Delete (file)

static File.Delete(string filename)
Deletes the specified file from the disk.

This command only works with files in the game directory. You CANNOT use a path, so any filename with "" or "/" in it will automatically be rejected, for security reasons.

The only exception to this rule is 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:

File.Delete("temp.tmp");
will delete the file "temp.tmp" from the game directory, if it exists.

Compatibility: Supported by AGS 3.0.1 and later versions.

See Also: File.Exists, File.Open


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