commandbox.system.modules_app.system-commands.commands

Class dir

lucee.Component
    extended by commandbox.system.modules_app.system-commands.commands.dir

List the files and folders in a directory. Defaults to current working directory . {code:bash} dir samples/ {code} . File globbing patterns can be used to filter results. Can also be a list . {code:bash} dir **.cfc,*.cfm {code} . File globbing patterns can be used to exclude results. Can also be a list . {code:bash} dir paths=modules excludePaths=**.md --recurse {code} . Use the "recurse" parameter to show all nested files and folders. . {code:bash} dir samples/ --recurse {code} . Ordering results is in format of an ORDER BY SQL clause. Invalid sorts are ignored. . {code:bash} dir samples "directory asc, name desc" {code}

Class Attributes:
  • aliases : ls,ll,directory
  •  
  • synchronized : false
  •  
  • accessors : false
  •  
  • persistent : false
  •  
    Method Summary
    private any cleanRecursiveDir(any directory, any incoming, [any type])
         Cleanup directory recursive nesting.
    private any colorPath([any name], [any type])
    private any renderFileSize(numeric size, [string type='bytes'])
         Returns file size in either b, kb, mb, gb, or tb.
    any run([commandbox.system.modules_app.system-commands.commands.Globber paths='[runtime expression]'], [any sort='type, name'], [string excludePaths=''], [boolean recurse='false'], [boolean simple='false'])
     
    Methods inherited from class lucee.Component
    None

    Method Detail

    cleanRecursiveDir

    private any cleanRecursiveDir(any directory, any incoming, [any type])

    Cleanup directory recursive nesting

    Parameters:
    directory
    incoming
    type

    colorPath

    private any colorPath([any name], [any type])

    Parameters:
    name
    type

    renderFileSize

    private any renderFileSize(numeric size, [string type='bytes'])

    Returns file size in either b, kb, mb, gb, or tb

    Parameters:
    size
    type

    run

    public any run([commandbox.system.modules_app.system-commands.commands.Globber paths='[runtime expression]'], [any sort='type, name'], [string excludePaths=''], [boolean recurse='false'], [boolean simple='false'])

    Parameters:
    paths
    sort - Sort columns and direction. name, directory, size, type, dateLastModified, attributes, mode
    excludePaths - A list of file glob patterns to exclude
    recurse - Include nested files and folders
    simple - Output only path names and nothing else.