STRLS(3ast)

NAME
fmtls - format file information in buffer

SYNOPSIS
    #include <ls.h>
    char*         fmtls(char* buf, char* name, struct stat* st, char* info, char* link, int flags);

DESCRIPTION
formats ls(1) style file information into the buffer buf. A pointer to the trailing 0 in buf is returned. name is the file name. st is a pointer to the struct stat status information for name obtained from one of the stat(2) routines. info is an additional string that will appear before name in buf and link is the name of the related hard or soft link file. Both info and link may be 0. flags controls the format style and may be a combination of the following:

LS_ATIME
    Use st->st_atime rather than st->st_mtime for LS_LONG.

LS_CTIME
    Use st->st_mtime rather than st->st_mtime for LS_LONG.

LS_BLOCKS
    List the number of blocks.

LS_INUMBER
    List the file serial number (inode number).

LS_LONG
    List the file mode, link count, user and group name, size or major/minor device number, and date along with the file name.

LS_MARK
    The file name is appended with for directories, for symbolic links, and for executable files.

LS_NOGROUP
    Omit the group name from LS_LONG.

LS_NOUSER
    Omit the user name from LS_LONG.

The user and group fields are each LS_W_NAME characters wide, the LS_INUMBER field is LS_W_INUMBER characters wide, and the LS_BLOCKS field is LS_W_BLOCKS characters wide.

SEE ALSO
ls(1), stat(2), strmode(3)