os

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = module.NewBuiltin().
	Func("o_rdonly() (value int)  open the file read-only", func() int { return os.O_RDONLY }).
	Func("o_wronly() (value int)  open the file write-only", func() int { return os.O_WRONLY }).
	Func("o_rdwr() (value int)    open the file read-write", func() int { return os.O_RDWR }).
	Func("o_append() (value int)  append data to the file when writing", func() int { return os.O_APPEND }).
	Func("o_create() (value int)  create a new file if none exists", func() int { return os.O_CREATE }).
	Func("o_excl() (value int)    fail if the file already exists", func() int { return os.O_EXCL }).
	Func("o_sync() (value int)    open for synchronous I/O", func() int { return os.O_SYNC }).
	Func("o_trunc() (value int)   truncate regular writable file when opened", func() int { return os.O_TRUNC }).
	Const("mode_dir int", int64(os.ModeDir)).
	Const("mode_append int", int64(os.ModeAppend)).
	Const("mode_exclusive int", int64(os.ModeExclusive)).
	Const("mode_temporary int", int64(os.ModeTemporary)).
	Const("mode_symlink int", int64(os.ModeSymlink)).
	Const("mode_device int", int64(os.ModeDevice)).
	Const("mode_named_pipe int", int64(os.ModeNamedPipe)).
	Const("mode_socket int", int64(os.ModeSocket)).
	Const("mode_setuid int", int64(os.ModeSetuid)).
	Const("mode_setgui int", int64(os.ModeSetgid)).
	Const("mode_char_device int", int64(os.ModeCharDevice)).
	Const("mode_sticky int", int64(os.ModeSticky)).
	Const("mode_type int", int64(os.ModeType)).
	Const("mode_perm int", int64(os.ModePerm)).
	Func("path_separator() (value string)      OS-specific path element separator", func() string { return string(os.PathSeparator) }).
	Func("path_list_separator() (value string) OS-specific PATH list separator", func() string { return string(os.PathListSeparator) }).
	Func("dev_null() (value string)            OS-specific null device path", func() string { return os.DevNull }).
	Const("seek_set int", int64(io.SeekStart)).
	Const("seek_cur int", int64(io.SeekCurrent)).
	Const("seek_end int", int64(io.SeekEnd)).
	Func("args() (args []string)", osArgs).
	Func("chdir(dir string) error", osChdir).
	Func("chmod(name string, mode int) error", func(s string, i int64) error { return os.Chmod(s, os.FileMode(i)) }).
	Func("chown(name string, uid int, gid int) error", os.Chown).
	Func("clearenv()", osClearenv).
	Func("environ() (env []string)", os.Environ).
	Func("exit(code int)", osExit).
	Func("expand_env(s string) (result string)", osExpandEnv).
	Func("getegid() (egid int)", os.Getegid).
	Func("getenv(s string) (value string)", os.Getenv).
	Func("geteuid() (euid int)", os.Geteuid).
	Func("getgid() (gid int)", os.Getgid).
	Func("getgroups() (gids []int)", os.Getgroups).
	Func("getpagesize() (size int)", os.Getpagesize).
	Func("getpid() (pid int)", os.Getpid).
	Func("getppid() (ppid int)", os.Getppid).
	Func("getuid() (uid int)", os.Getuid).
	Func("getwd() (dir string)", os.Getwd).
	Func("hostname() (name string)", os.Hostname).
	Func("lchown(name string, uid int, gid int) error", os.Lchown).
	Func("link(oldname string, newname string) error", os.Link).
	Func("lookup_env(key string) (value string, found bool)", osLookupEnv).
	Func("mkdir(name string, perm int) error", func(s string, i int64) error { return os.Mkdir(s, os.FileMode(i)) }).
	Func("mkdir_all(name string, perm int) error", func(s string, i int64) error { return os.MkdirAll(s, os.FileMode(i)) }).
	Func("readlink(name string) (result string)", os.Readlink).
	Func("remove(name string) error", os.Remove).
	Func("remove_all(name string) error", os.RemoveAll).
	Func("rename(oldpath string, newpath string) error", os.Rename).
	Func("setenv(key string, value string) error", osSetenv).
	Func("symlink(oldname string, newname string) error", os.Symlink).
	Func("temp_dir() (dir string)", os.TempDir).
	Func("truncate(name string, size int) error", os.Truncate).
	Func("unsetenv(key string) error", osUnsetenv).
	Func("create(name string) (file imap(file))", osCreate).
	Func("open(name string) (file imap(file))", osOpen).
	Func("open_file(name string, flag int, perm int) (file imap(file))", osOpenFile).
	Func("find_process(pid int) (process imap(process))", osFindProcess).
	Func("start_process(name string, argv array(string), dir string, env array(string)) (process imap(process))", osStartProcess).
	Func("exec_look_path(file string) (result string)", module.Func(exec.LookPath)).
	Func("exec(name string, args ...string) (command imap(command))", osExec).
	Func("stat(name string) (fileinfo imap(fileinfo))", osStat).
	Func("read_file(name string) (content bytes)", osReadFile)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL