-
Notifications
You must be signed in to change notification settings - Fork 303
Module: OS
Daniel Kang edited this page Jan 18, 2019
·
3 revisions
os := import("os") // variable name doesn't have to be 'os'
-
o_rdonly
: equivalent of Go'sos.O_RDONLY
-
o_wronly
: equivalent of Go'sos.O_WRONLY
-
o_rdwr
: equivalent of Go'sos.O_RDWR
-
o_append
: equivalent of Go'sos.O_APPEND
-
o_create
: equivalent of Go'sos.O_CREATE
-
o_excl
: equivalent of Go'sos.O_EXCL
-
o_sync
: equivalent of Go'sos.O_SYNC
-
o_trunc
: equivalent of Go'sos.O_TRUNC
-
mode_dir
: equivalent of Go'sos.ModeDir
-
mode_append
: equivalent of Go'sos.ModeAppend
-
mode_exclusive
: equivalent of Go'sos.ModeExclusive
-
mode_temporary
: equivalent of Go'sos.ModeTemporary
-
mode_symlink
: equivalent of Go'sos.ModeSymlink
-
mode_device
: equivalent of Go'sos.ModeDevice
-
mode_named_pipe
: equivalent of Go'sos.ModeNamedPipe
-
mode_socket
: equivalent of Go'sos.ModeSocket
-
mode_setuid
: equivalent of Go'sos.ModeSetuid
-
mode_setgui
: equivalent of Go'sos.ModeSetgid
-
mode_char_device
: equivalent of Go'sos.ModeCharDevice
-
mode_sticky
: equivalent of Go'sos.ModeSticky
-
mode_irregular
: equivalent of Go'sos.ModeIrregular
-
mode_type
: equivalent of Go'sos.ModeType
-
mode_perm
: equivalent of Go'sos.ModePerm
-
seek_set
: equivalent of Go'sos.SEEK_SET
-
seek_cur
: equivalent of Go'sos.SEEK_CUR
-
seek_end
: equivalent of Go'sos.SEEK_END
-
path_separator
: equivalent of Go'sos.PathSeparator
-
path_list_separator
: equivalent of Go'sos.PathListSeparator
-
dev_null
: equivalent of Go'sos.DevNull
-
args() => array(string)
: returnsos.Args
-
chdir(dir string) => error
: port ofos.Chdir
function -
chmod(name string, mode int) => error
: port of Go'sos.Chmod
function -
chown(name string, uid int, gid int) => error
: port of Go'sos.Chown
function -
clearenv()
: port of Go'sos.Clearenv
function -
environ() => array(string)
: port of Go'sos.Environ
function -
executable() => string/error
: port of Go'sos.Executable()
function -
exit(code int)
: port of Go'sos.Exit
function -
expand_env(s string) => string
: port of Go'sos.ExpandEnv
function -
getegid() => int
: port of Go'sos.Getegid
function -
getenv(s string) => string
: port of Go'sos.Getenv
function -
geteuid() => int
: port of Go'sos.Geteuid
function -
getgid() => int
: port of Go'sos.Getgid
function -
getgroups() => array(string)/error
: port of Go'sos.Getgroups
function -
getpagesize() => int
: port of Go'sos.Getpagesize
function -
getpid() => int
: port of Go'sos.Getpid
function -
getppid() => int
: port of Go'sos.Getppid
function -
getuid() => int
: port of Go'sos.Getuid
function -
getwd() => string/error
: port of Go'sos.Getwd
function -
hostname() => string/error
: port of Go'sos.Hostname
function -
lchown(name string, uid int, gid int) => error
: port of Go'sos.Lchown
function -
link(oldname string, newname string) => error
: port of Go'sos.Link
function -
lookup_env(key string) => string/false
: port of Go'sos,LookupEnv
function -
mkdir(name string, perm int) => error
: port of Go'sos.Mkdir
function -
mkdir_all(name string, perm int) => error
: port of Go'sos.MkdirAll
function -
readlink(name string) => string/error
: port of Go'sos.Readlink
function -
remove(name string) => error
: port of Go'sos.Remove
function -
remove_all(name string) => error
: port of Go'sos.RemoveAll
function -
rename(oldpath string, newpath string) => error
: port of Go'sos.Rename
function -
setenv(key string, value string) => error
: port of Go'sos.Setenv
function -
symlink(oldname string newname string) => error
: port of Go'sos.Symlink
function -
temp_dir() => string
: port of Go'sos.TempDir
function -
truncate(name string, size int) => error
: port of Go'sos.Truncate
function -
unsetenv(key string) => error
: port of Go'sos.Unsetenv
function -
user_cache_dir() => string/error
: port of Go'sos.UserCacheDir
function -
create(name string) => File/error
: port of Go'sos.Create
function -
open(name string) => File/error
: port of Go'sos.Open
function -
open_file(name string, flag int, perm int) => File/error
: port of Go'sos.OpenFile
function -
find_process(pid int) => Process/error
: port of Go'sos.FindProcess
function -
start_process(name string, argv array(string), dir string, env array(string)) => Process/error
: port of Go'sos.StartProcess
function
file := os.create("myfile")
file.write_string("some data")
file.close()
-
chdir() => true/error
: port ofos.File.Chdir
function -
chown(uid int, gid int) => true/error
: port ofos.File.Chown
function -
close() => error
: port ofos.File.Close
function -
name() => string
: port ofos.File.Name
function -
readdirnames() => array(string)/error
: port ofos.File.Readdirnames
function -
sync() => error
: port ofos.File.Sync
function -
write(bytes) => int/error
: port ofos.File.Write
function -
write_string(string) => int/error
: port ofos.File.WriteString
function -
read(bytes) => int/error
: port ofos.File.Read
function -
chmod(mode int) => error
: port ofos.File.Chmod
function -
seek(offset int, whence int) => int/error
: port ofos.File.Seek
function
proc := start_process("app", ["arg1", "arg2"], "dir", [])
proc.wait()
-
kill() => error
: port ofos.Process.Kill
function -
release() => error
: port ofos.Process.Release
function -
signal(signal int) => error
: port ofos.Process.Signal
function -
wait() => ProcessState/error
: port ofos.Process.Wait
function
proc := start_process("app", ["arg1", "arg2"], "dir", [])
stat := proc.wait()
pid := stat.pid()
-
exited() => bool
: port ofos.ProcessState.Exited
function -
pid() => int
: port ofos.ProcessState.Pid
function -
string() => string
: port ofos.ProcessState.String
function -
success() => bool
: port ofos.ProcessState.Success
function