Module file

File operations.

Info:

Functions

attributes(mode, owner, group)
Set path attributes such as the mode, owner or group.

Promiser:

    path to file

Parameters:

  • mode set the file mode bits
  • owner set the uid/owner [ALIAS: uid]
  • group set the gid/group [ALIAS: gid]

Usage:

    file.attributes("/etc/shadow"){
         mode = 0600,
        owner = "root",
        group = "root"
    }
link(src, force)
Create a symlink.

Promiser:

    symlink path

Parameters:

  • src path where the symlink points to [REQUIRED]
  • force remove existing symlink

Usage:

    file.link("/home/ed/root"){
        src = "/"
    }
hard(src, force)
Create a hard link.

Promiser:

    hard link path

Parameters:

  • src path where the hard link points to [REQUIRED]
  • force remove existing hard link

Usage:

    file.hard("/home/ed/root"){
        src = "/"
    }
directory(mode, owner, group, force, backup)
Create a directory.

Promiser:

    directory path

Parameters:

  • mode set the file mode bits
  • owner set the uid/owner [ALIAS: uid]
  • group set the gid/group [ALIAS: gid]
  • force remove existing path before creating directory [DEFAULT: "no", false]
  • backup rename existing path and prepend '.configi' to the name [DEFAULT: "no", false]

Usage:

    file.directory("/usr/portage")()
touch(mode, owner, group)
Touch a path.

Promiser:

    path

Parameters:

  • mode set the file mode bits
  • owner set the uid/owner [ALIAS: uid]
  • group set the gid/group [ALIAS: gid]

Usage:

    file.touch("/srv/.keep")()
absent(S)
Remove a path.

Promiser:

    path

Parameters:

  • S

Usage:

    file.absent("/home/ed/.xinitrc")()
copy(path, recurse, force, backup)
Copy a path.

Promiser:

    path

Parameters:

  • path destination path [REQUIRED] [ALIAS: dest,target]
  • recurse recursively copy source [DEFAULT: "no", false]
  • force remove existing destination before copying [DEFAULT: "no", false]
  • backup rename existing path and prepend '.configi' to the name [DEFAULT: "no", false]

Usage:

    file.copy("/home/ed"){
        dest = "/mnt/backups"
    }
generated by LDoc 1.4.6 Last updated 2017-05-09 15:50:38