Top Documents Download Gallery Repository
Are you looking for a Software Engineer? Check Here

39os Module

The os module provides functions that are specific to each OS environment. This is a built-in module, so you can use it without being imported.

39.1Module Function

os.clock
os.clock() {block?}
Returns the time duration in second since the system has started.

If block is specified, it would calculate how much time has been spent during evaluating the block.

os.exec
os.exec(pathname:string, args*:string):map:[fork]
Executes the specified executable file.

os.fromnative
os.fromnative(buff:binary):map
Converts binary data that includes OS's native string into Gura's regulated string.

os.getenv
os.getenv(name:string, default?:string):map
Returns the value of an environment variable.

os.putenv
os.putenv(name:string, value:string):void
Set the value of an environment variable.

os.redirect
os.redirect(stdin:stream:nil:r, stdout:stream:nil:w, stderr?:stream:w) {block?}
Modifies variables os.stdin, os.stdout and os.stderr with values of arguments. When block is specified, the modification only has effect within the block.

os.sleep
os.sleep(secs:number)
Sleeps for a time specified in seconds.

os.symlink
os.symlink(src:string, tgt:string):map:void
Creates a symbol link.

os.tonative
os.tonative(str:string):map
Converts Gura's regulated string into binary data that includes OS's native string.

os.unsetenv
os.unsetenv(name:string):void
Unset an environment variable.


Copyright (C) 2011-2017 ypsitau