Fs (API)

From ComputerCraft Wiki
Revision as of 03:44, 12 March 2012 by Hawk777 (Talk | contribs) (Parameter fixes)

Jump to: navigation, search

The FS API allows you to mess around with the filesystem.

Method name Description
fs.list(path) Lists the directories and files in the given directory
fs.exists(path) Checks if a path refers to an existing file or directory
fs.isDir(path) Checks if a path refers to an existing directory
fs.isReadOnly(path) Checks if a path is read-only (i.e. cannot be modified)
fs.getName(path) Gets the final component of a pathname
fs.getDrive(path) Gets the type of storage medium holding a file or directory
fs.makeDir(path) Makes a directory
fs.move(fromPath, toPath) Moves a file or directory to a new location
fs.copy(fromPath, toPath) Copies a file or directory to a new location
fs.delete(path) Deletes a file or directory
fs.combine(basePath, localPath) Combines two path components, returning a path consisting of the local path nested inside the base path
fs.open(path, mode) Opens a file so it can be read or written