fs.isReadOnly

Returns true if the file or directory at path path is read-only, meaning files cannot be created or changed there. Returns false if the path path is writable, or if it does not exist. /rom is an example of a read-only mount you cannot create your own files there, or change files there.

ExampleCheck if two directories are read-only
Creates the directory foo in the root directory (/), and checks if it is read-only. Also checks if /rom/programs is read-only.
Code
<nowiki>
print("Making foo")
fs.makeDir("foo")
print("/foo is read-only:", fs.isReadOnly("/foo"))
print("/rom/programs is read-only:", fs.isReadOnly("/rom/programs"))
    </nowiki>
Output
<nowiki>
Making foo
/foo is read-only: false
/rom/programs is read-only: true
</nowiki>

fs.isReadOnly
Function
Syntax
fs.isReadOnly(
  • path : string
)

Returns boolean
API fs
Source CC:Tweaked (source)
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.