STRLS(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

okay bestie, welcome to the Library Functions Manual page for fmtls, aka STRLS(3) πŸ’–

πŸŽ€ 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 πŸ’…

okay so fmtls formats ls(1)-style file information into the buffer buf. What you get back is a pointer to the trailing 0 in buf β€” literally the end of the string, bestie 🫢.

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, no cap:

  • 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. (bestie the page literally says st->st_mtime instead of st->st_mtime β€” we keep it exactly as written πŸ’€)
  • 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. Slay, the widths are locked in πŸ“βœ¨.

🌈 SEE ALSO 🌈

and that’s the STRLS(3) page, bestie β€” mwah πŸ’–

πŸ“¦ where this page comes from