file

The global instance of FileAPI
field signature:
file
Method Property Fluent Description Representation
Field Type a FileAPI

FileAPI.list

Lists all files and directories at specified path, or returns null if directory does not exist or path is not a directory
overload 1:
file:list(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a table

FileAPI.delete

Deletes file/directory at specified path. Returns true if successful
overload 1:
file:delete(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

FileAPI.exists

Checks if file/directory at specified path exists
overload 1:
file:exists(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

FileAPI.isDirectory

Checks if specified path is directory
overload 1:
file:isDirectory(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

FileAPI.mkdir

Creates a directory at specified path. Returns true if folder was successfully created
overload 1:
file:mkdir(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

FileAPI.mkdirs

Creates a directory at specified path including all parent directories. Returns true if folder was successfully created
overload 1:
file:mkdirs(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

FileAPI.isFile

Checks if specified path is file
overload 1:
file:isFile(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean

FileAPI.readString

Reads whole file as string
overload 1:
file:readString(path, encoding)
Method Property Fluent Description Representation
path accepts a String
encoding accepts a String
Return Value a String

FileAPI.writeString

Writes a string to a file
overload 1:
file:writeString(path, data, encoding)
Method Property Fluent Description Representation
path accepts a String
data accepts a String
encoding accepts a String
Return Value nil

FileAPI.allowed

Checks if FileAPI can be used for this avatar
overload 1:
file:allowed()
Method Property Fluent Description Representation
Return Value a Boolean

FileAPI.openReadStream

Opens an input stream for file at specified path
overload 1:
file:openReadStream(path)
Method Property Fluent Description Representation
path accepts a String
Return Value an InputStream

FileAPI.openWriteStream

Opens an output stream for file at specified path
overload 1:
file:openWriteStream(path)
Method Property Fluent Description Representation
path accepts a String
Return Value an OutputStream

FileAPI.isPathAllowed

Checks if this path is allowed for usage
overload 1:
file:isPathAllowed(path)
Method Property Fluent Description Representation
path accepts a String
Return Value a Boolean
a a