| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

format_dir

#include "sfldir.h"
char *
format_dir (
    DIRST *dir,
    Bool full)

Synopsis

Formats the directory entry information using the same conventions as the UNIX 'ls -l' command. Returns a static buffer that contains the the formatted string. If the full argument is TRUE, adds cosmetic hints to indicate the file type; for instance '/' if the file is a directory, '*' if it is executable.

Source Code - (sfldir.c)

{
    static char
        buffer [LINE_MAX];              /*  Formatted directory entry        */

    ASSERT (dir != NULL);
    snprintf (buffer, sizeof (buffer),
                      "%s %3d %-8.8s %-8.8s %8ld %s %s",
                      format_mode (dir),
                      dir-> file_nlink,
                      dir-> owner,
                      dir-> group,
                      (long) dir-> file_size,
                      format_time (dir),
                      format_name (dir, full)
           );
    return (buffer);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation