FileSystem
__index
It is of the type FileSystem
.
chdir(self, pathname) → a
The pathname parameter is a string
.
The only return is a string
.
copy(self, pathnameFrom, pathnameTo)
The parameters for copy
are as follows:
- The pathnameFrom parameter is a
string
. - The pathnameTo parameter is a
string
. It can also benil
.
It has no return values.
exists(pathname) → a
The pathname parameter is a string
.
The only return is a boolean
.
filename(pathname) → a
The pathname parameter is a string
.
The only return is a string
.
join(...) → a
The variadic parameter is a string
.
The only return is a string
.
mkdir(self, pathname)
The pathname parameter is a string
. It can also be nil
.
It has no return values.
mklink(self, linkName, targetName)
The parameters for mklink
are as follows:
- The linkName parameter is a
string
. - The targetName parameter is a
string
. It can also benil
.
It has no return values.
moveMerge(self, pathnameFrom, pathnameTo)
The parameters for moveMerge
are as follows:
- The pathnameFrom parameter is a
string
. - The pathnameTo parameter is a
string
. It can also benil
.
It has no return values.
new(source) → a
The source parameter can be any of the following types:
It can also be nil
.
The only return is a FileSystem
.
parentdir(pathname) → a
The pathname parameter is a string
.
The only return is a string
.
pwd(self) → a
It has no parameters.
The only return is a string
.
readdir(self, pathname) → a
The pathname parameter is a string
.
The only return is an array of a string
s.
readfile(self, filepath) → a
The filepath parameter is a string
.
The only return is a string
.
rename(self, pathnameFrom, pathnameTo)
The parameters for rename
are as follows:
- The pathnameFrom parameter is a
string
. - The pathnameTo parameter is a
string
. It can also benil
.
It has no return values.
resolve(pathname) → a
The pathname parameter is a string
.
The only return is a string
.
separator
It is of the type string
.
split(pathname) → a
The pathname parameter is a string
.
The only return is an array of a string
s.
unlink(self, pathname)
The pathname parameter is a string
.
It has no return values.
writefile(self, filepath, contents)
The parameters for writefile
are as follows:
- The filepath parameter is a
string
. - The contents parameter is a
string
.
It has no return values.
Luau Type
This is the luau type for FileSystem
. It may help clear up mistranslations from the raw data to the wiki page (as it is an automatic process).
export type FileSystem = {
split: (pathname: string) -> ({ string }),
copy: (self: FileSystem, pathnameFrom: string, pathnameTo: string?) -> (),
mkdir: (self: FileSystem, pathname: string?) -> (),
pwd: (self: FileSystem) -> (string),
readdir: (self: FileSystem, pathname: string) -> ({ string }),
__index: FileSystem,
new: (source: (FileSystemRoot | FileSystemDirectory)?) -> (FileSystem),
separator: string,
resolve: (pathname: string) -> (string),
parentdir: (pathname: string) -> (string),
join: (...string) -> (string),
filename: (pathname: string) -> (string),
unlink: (self: FileSystem, pathname: string) -> (),
readfile: (self: FileSystem, filepath: string) -> (string),
exists: (pathname: string) -> (boolean),
moveMerge: (self: FileSystem, pathnameFrom: string, pathnameTo: string?) -> (),
mklink: (self: FileSystem, linkName: string, targetName: string?) -> (),
writefile: (self: FileSystem, filepath: string, contents: string) -> (),
rename: (self: FileSystem, pathnameFrom: string, pathnameTo: string?) -> (),
chdir: (self: FileSystem, pathname: string) -> (string),
}