AngelScript
filesystem
Note
filesystem is only available in the scripts if the application registers support for it.

Supporting filesystem object

Methods

bool changeCurrentPath(const string &in path)

This changes the current directory used by the filesystem object. It will return true if the given path is valid.

It doesn't change the application' working directory.

string getCurrentPath() const

Returns the current path used by the filesystem object.

array<string> @getDirs()

Returns a list with the names of all directories in the current path.

array<string> @getFiles()

Returns a list with the names of all files in the current path.

bool isDir(const string &in path)

Returns true if the given path is a directory.

bool isLink(const string &in path)

Returns true if the given path is a link.

int64 getSize(const string &in) const

Returns the size of a file.

Returns -1 if the file doesn't exist or cannot be accessed.

int makeDir(const string &in)

Creates a new directory. Returns 0 on success.

int removeDir(const string &in)

Removes a directory. Will only remove the directory if it is empty. Returns 0 on success.

int deleteFile(const string &in)

Deletes a file. Returns 0 on success.

int copyFile(const string &in, const string &in)

Copies a file. Returns 0 on success.

int move(const string &in, const string &in)

Moves or renames a file or directory. Returns 0 on success.

datetime getCreateDateTime(const string &in)

Returns the date and time of the file creation in UTC.

Raises an exception if the file doesn't exist or cannot be accessed.

datetime getModifyDateTime(const string &in)

Returns the date and time of the last modification of the file in UTC.

Raises an exception if the file doesn't exist or cannot be accessed.