Contents

Roo

FileUtils.cwd_path

Returns the current working directory (cwd) of the script as a Text object. If Roo is interpreting an actual script file then the cwd will be the folder on disk containing the current script file. If Roo is in REPL mode then it will be Nothing.

# Create a new file in the current working directory.
var f = File(FileUtils.cwd_path + "/new.txt")
var success = f.write_line("Hello!")
print(success ? "It worked!" : "Didn't work")