fs.isReadOnly

From ComputerCraft Wiki
Jump to: navigation, search


Grid Redstone.png  Function fs.isReadOnly
Checks if a path is read-only (i.e. cannot be modified). The path need not exist in order to perform this test. Note that the root directory and the mount points of any floppy disks are considered read-only, perhaps because they cannot themselves be modified, only their contents can be.
Syntax fs.isReadOnly(string path)
Returns boolean false if path can be written to, or true if not
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Checks that the "rom" directory is read-only, as its name implies
Code
print(fs.isReadOnly("rom"))
Output true