sys Module

$

$str str get-env

See get-env.

$

$ get-env

See get-env.

!

!str str system

See system.

!

! system

See system.

&

&str str run

See run.

&

& run

See run.

.

str

Returns the full path to the current directory.

..

str

Returns the full path to the parent directory.

admin?

bool

Returns true if the program is being run with administrative privileges.

chmod

'sym int

Sets the permissions of file or directory 'sym to int. int is a three-digit representation of user, group and other permissions. See the Unix Permissions Calculator for examples and conversions.

cd

'sym

Change the current directory to 'sym.

cp

'sym1 'sym2

Copies the file or directory 'sym1 to 'sym2.

cpu

str

Returns the host CPU. It can be one of the following strings i386, alpha, powerpc, powerpc64, powerpc64el, sparc, amd64, mips, mipsel, arm, arm64.

env?

'sym bool

Returns true if environment variable 'sym exists, false otherwise.

get-env

'sym str

Returns environment variable 'sym.

hardlink

'sym1 'sym2

Creates hardlink 'sym2 for file or directory 'sym1.

ls

'sym quot

Returns a quotation quot containing all children (files and directories) of the directory 'sym.

ls-r

'sym quot

Returns a quotation quot containing all children (files and directories) of the directory 'sym, recursively.

mkdir

'sym

Creates the specified directory 'sym.

mv

'sym1 'sym2

Moves the file or directory 'sym1 to 'sym2.

os

str

Returns the host operating system. It can be one of the following strings: windows, macosx, linux, netbsd, freebsd, openbsd, solaris, aix, standalone.

put-env

'sym1 'sym2 str

Sets environment variable 'sym2 to 'sym1.

rm

'sym

Deletes the specified file 'sym.

rmdir

'sym

Deletes the specified directory 'sym and all its subdirectories recursively.

run

'sym dict

Executes the external command 'sym in the current directory without displaying its output. Returns a dictionary containing the command output and return code (in keys output and code respectively).

sleep

int

Halts program execution for int milliseconds.

symlink

'sym1 'sym2

Creates symlink 'sym2 for file or directory 'sym1.

system

'sym int

Executes the external command 'sym in the current directory and pushes its return code on the stack.

unzip

'sym1 'sym2

Decompresses zip file 'sym1 to directory 'sym2 (created if not present).

which

'sym str

Returns the full path to the directory containing executable 'sym, or an empty string if the executable is not found in $PATH.

zip

quot 'sym

Compresses files included in quotation quot into zip file 'sym.