pocketlang/docs/Reference/os.md
Thakee Nathees 5bc9dcad6b method bind implemented
- MethodBind type added.
- Now methods are first class and can be passed around as arguments
  store as a variable and return it from a function and they're first
  class callbales.
- Can bind instance to a method bind using .bind() method
- Class.methods() method added -> return a list of all methods as
  method binds
- Module.globals() method added -> returns a list of all globals
  of that module.
- Var._class -> attribute added which will return the class of the
  variable
- Class.name, MethodBind.name, Closure.name attribute and Modue._name
  attribute added
- Class._docs, Closure._docs, MethodBind._docs attribute added
- MethodBind.instance attribute added
2022-06-06 02:47:31 +05:30

1.0 KiB

os

getcwd

os.getcwd() -> String

Returns the current working directory

chdir

os.chdir(path:String)

Change the current working directory

mkdir

os.mkdir(path:String)

Creates a directory at the path. The path should be valid.

rmdir

os.rmdir(path:String)

Removes an empty directory at the path.

os.rmdir(path:String)

Removes a file at the path.

moditime

os.moditime(path:String) -> Number

Returns the modified timestamp of the file.

filesize

os.filesize(path:String) -> Number

Returns the file size in bytes.

system

os.system(cmd:String) -> Number

Execute the command in a subprocess, Returns the exit code of the child process.

getenv

os.getenv(name:String) -> String

Returns the environment variable as String if it exists otherwise it'll return null.

exepath

os.exepath() -> String

Returns the path of the pocket interpreter executable.