pocketlang/docs/Reference/path.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.4 KiB

path

getcwd

path.getcwd() -> String

Returns the current working directory.

abspath

path.abspath(path:String) -> String

Returns the absolute path of the [path].

relpath

path.relpath(path:String, from:String) -> String

Returns the relative path of the [path] argument from the [from] directory.

join

path.join(...) -> String

Joins path with path seperator and return it. The maximum count of paths which can be joined for a call is MAX_JOIN_PATHS.

normpath

path.normpath(path:String) -> String

Returns the normalized path of the [path].

basename

path.basename(path:String) -> String

Returns the final component for the path

dirname

path.dirname(path:String) -> String

Returns the directory of the path.

isabspath

path.isabspath(path:String) -> Bool

Returns true if the path is absolute otherwise false.

getext

path.getext(path:String) -> String

Returns the file extension of the path.

exists

path.exists(path:String) -> String

Returns true if the file exists.

isfile

path.isfile(path:String) -> Bool

Returns true if the path is a file.

isdir

path.isdir(path:String) -> Bool

Returns true if the path is a directory.

listdir

path.listdir(path:String='.') -> List

Returns all the entries in the directory at the [path].