fn: lst
[contents]

Contents

Syntax

The syntax for lst calls is:

f++:  
lst(param)
lst param

n++:  
@lst(param)
@lst param

Description

The lst function is for listing files in a directory, it takes zero parameters or a single parameter specifying which directory to list files for.

Note: Paths can be unoquoted, single quoted or double quoted.

Note: When writing to the console Nift will skip to the first non-whitespace (ie. to the first character that is not a space, tab or newline) after a lst call and inject it to the output file where the call started. If you want to prevent Nift from doing this put a '!' after the call, eg.:

@lst ~/;!
@lst(~/)!

Options

The following options are available for lst calls:

option description
1 list one file per line
\, separate files with commas
a do not ignore entries starting with .
!c do not list files on console
c list files on console
P list full paths to files
option description
Note: If other options are given Nift will attempt to use the system's underlying list function instead, typically dir on Windows and ls on platforms like FreeBSD, Linux, OSX, etc..

f++ example

Examples of lst being used with f++:

lst
lst{1} ~/
lst{-l} "/usr/local/bin"
lst{a}("/usr/local")

n++ example

Example of lst being used with n++:

@lst
@lst{1} ~/
@lst{-l} "/usr/local/bin"
@lst{a}("/usr/local")