VERGELua API

filesystem

File access and HTTP.

filesystem

filesystem.CreateDirectory(path:string):boolean, string

Create a directory under the game folder; returns success and the path.

filesystem.EnumerateDirectory(path:string, callback:function)

Call callback(filename, attributes) for each matching entry; path may be a glob.

filesystem.GetFileTime(path:string):number, number, number

Return creation, access and write times as Unix seconds.

filesystem.GetFileAttributes(path:string):number

Return the file's attribute flags; -1 (INVALID_FILE_ATTRIBUTES) when the path is missing or outside the game folder.

filesystem.SetFileAttributes(path:string, attributes:number):boolean

Set the file's attribute flags.

filesystem.ReadFile(path:string):string?

Read a file's contents, or nil when missing or outside the game folder.

filesystem.WriteFile(path:string, content:string):boolean

Write text to a file inside the game folder.

http

http.Get(url:string):string

Blocking HTTP GET; returns the response body, or an empty string on failure.

http.GetAsync(url:string, callback:function)

Non-blocking GET; callback(data) runs on a later frame.