os


Functions

platform()

->``"LINUX" | "MACINTOSH" | "WINDOWS"

Returns the platform the script is running on:

return #1:
    | "WINDOWS"
    | "MACINTOSH"
    | "LINUX"

currentdir()

->path : string

Returns the current working dir. Will always be the scripts directory when executing a script from a file

dirnames(path : any)

->paths : string[]

Returns a list of directory names (names, not full paths) for the given parent directory. Passed directory must be valid, or an error will be thrown.

filenames(path : string, file_extensions : string[]?)

->paths : string[]

Returns a list file names (names, not full paths) for the given parent directory. Second optional argument is a list of file extensions that should be searched for, like {".wav", ".txt"}. By default all files are matched. The passed directory must be valid, or an error will be thrown.

mkdir(path : string)

->boolean?, string?

Creates a new directory. mkdir can only create one new sub directory at the same time. If you need to create more than one sub dir, call mkdir multiple times. Returns true if the operation was successful; in case of error, it returns nil plus an error string.

move(src : string, dest : string)

->boolean?, string?

Moves a file or a directory from path 'src' to 'dest'. Unlike 'os.rename' this also supports moving a file from one file system to another one. Returns true if the operation was successful; in case of error, it returns nil plus an error string.

tmpname(extension : string?)

->string

Changed in Renoises: Returns a temp directory and name which renoise will clean up on exit.

clock()

->number

Replaced with a high precision timer (still expressed in milliseconds)

exit()

Will not exit, but fire an error that os.exit() can not be called