kiwi
kiwi copied to clipboard
Feature - Builtin Methods - CanRead, CanWrite, GetPermissions, SetPermissions
CanRead/CanWrite returns false if the path does not exist. It returns a boolean value indicating read/write access, depending on the method. It will not throw an exception.
fn read(path)
return "" when !fs::readable(path) # or `fs::can_read(path)`, etc
return fs::read(path)
end
Will need to put more thought into GetPermissions/SetPermissions
perms = fs::get_perms(file)
fs::set_perms(file, bitmask)