diff options
Diffstat (limited to '.lush/scripts')
| -rw-r--r-- | .lush/scripts/example.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/.lush/scripts/example.lua b/.lush/scripts/example.lua index 04cb516..9cf3c96 100644 --- a/.lush/scripts/example.lua +++ b/.lush/scripts/example.lua @@ -49,3 +49,20 @@ lush.cd(cwd) if lush.exists("~/.lush/scripts/example.lua") then print("example.lua exists") end + +-- isFile and isDir check if a path points to a file or a directory +if lush.isFile("~/.lush/scripts/example.lua") then + print("example.lua is a file") +end + +if not lush.isDirectory("~/.lush/scripts/example.lua") then + print("example.lua is not a directory") +end + +-- you can also check if a file is readable/writeable +if lush.isReadable("~/.lush/scripts/example.lua") then + print("example.lua is readable") +end +if lush.isWriteable("~/.lush/scripts/example.lua") then + print("example.lua is writeable") +end |
