luaposix 35.1 Reference

# Module `posix.libgen`

General Library.

Functions for separating a pathname into file and directory components.

## Functions

basename (path) | File part of path.
dirname (path) | Directory name of path.

## Functions

basename (path)
  File part of path.

  ### Parameters:

  - path string file to act on

  ### Returns:

  string filename part of path, if successful

  ### Or

  1. nil
  2. string error message
  3. int errnum

  ### See also:

  basename(3)
dirname (path)
  Directory name of path.

  ### Parameters:

  - path string file to act on

  ### Returns:

  string directory part of path, if successful

  ### Or

  1. nil
  2. string error message
  3. int errnum

  ### See also:

  dirname(3)

generated by LDoc 1.4.6 Last updated 2021-09-09 17:41:28