Enfusion Script API
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
FileIO Interface Reference

Static Public Member Functions

static bool FileExist (string name)
 
static proto ref FileHandle OpenFile (string name, FileMode mode)
 Opens a File.
 
static proto ParseHandle BeginParse (string filename)
 Creates a parser for a given filename It can be then used with ParseLine and EndParse.
 
static proto bool FileExists (string name)
 Check existence of file.
 
static proto bool MakeDirectory (string name)
 Makes a directory tree.
 
static proto bool DeleteFile (string name)
 delete file. Works only on "$profile:", "$logs:" and "$saves:" locations
 
static proto bool CopyFile (string sourceName, string destName)
 copy file. destName must be "$profile:", "$logs:" or "$saves:" location
 
static proto bool FindFiles (FindFilesCallback callback, string path, string ext)
 Find files with extension in given path on all FileSystems accessible for game.
 

Member Function Documentation

◆ BeginParse()

static proto ParseHandle FileIO.BeginParse ( string  filename)
static

Creates a parser for a given filename It can be then used with ParseLine and EndParse.

◆ CopyFile()

static proto bool FileIO.CopyFile ( string  sourceName,
string  destName 
)
static

copy file. destName must be "$profile:", "$logs:" or "$saves:" location

◆ DeleteFile()

static proto bool FileIO.DeleteFile ( string  name)
static

delete file. Works only on "$profile:", "$logs:" and "$saves:" locations

◆ FileExist()

static bool FileIO.FileExist ( string  name)
static

◆ FileExists()

static proto bool FileIO.FileExists ( string  name)
static

Check existence of file.

◆ FindFiles()

static proto bool FileIO.FindFiles ( FindFilesCallback  callback,
string  path,
string  ext 
)
static

Find files with extension in given path on all FileSystems accessible for game.

array<string> files = {};
FileIO.FindFiles(files.Insert, "configs/", ".conf");
files.Debug();
Definition: FileIO.c:13
static proto bool FindFiles(FindFilesCallback callback, string path, string ext)
Find files with extension in given path on all FileSystems accessible for game.
Definition: Types.c:150
proto int Insert(T value)
Inserts element at the end of array.
void Debug()
Print all elements in array.
Definition: Types.c:322

◆ MakeDirectory()

static proto bool FileIO.MakeDirectory ( string  name)
static

Makes a directory tree.

◆ OpenFile()

static proto ref FileHandle FileIO.OpenFile ( string  name,
FileMode  mode 
)
static

Opens a File.

Parameters
nameName of a file to open. You can use filesystem prefixes. For accessing profile dir use '$profile', e.g. '$profile:myFileName.txt'.
modeConstants FileMode.WRITE, FileMode.READ or FileMode.APPEND flag can be used
Returns
file handle ID or 0 if fails

The documentation for this interface was generated from the following file: