* RFA - Remote File Access
* Access and Management for a partial file system tree that exists
* at two sites either as master files or slave files
* ls.c : prepare file info in a "ls" style
* Contributed by Oliver Wenzel, GMD Berlin, 1990
* $Header: /f/osi/others/rfa/RCS/ls.c,v 7.3 91/02/22 09:28:06 mrose Interim $
* Revision 7.3 91/02/22 09:28:06 mrose
* Revision 7.2 91/01/14 13:54:37 mrose
* Revision 1.1 91/01/04 16:06:44 ow
static char *rcsid
= "$Header: /f/osi/others/rfa/RCS/ls.c,v 7.3 91/02/22 09:28:06 mrose Interim $";
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
static struct pair ftype
[] = { {S_IFIFO
, "?"}, { S_IFCHR
, "c" }, {S_IFDIR
, "d"},
{S_IFBLK
, "b"}, { S_IFREG
, "-" }, {S_IFLNK
, "l"},
{S_IFSOCK
, "s"}, { 0, NULL
}};
static struct pair facc
[] = { { 01, "--x" }, { 02, "-w-" }, { 03, "-wx" },
{ 04, "r--" }, { 05, "r-x" }, { 06, "rw-" },
{ 07, "rwx" }, { 00, "---" } };
static void mode2str(m
, mstr
)
for (pp
= ftype
; pp
->s
; pp
++)
for (pp
= facc
; pp
->s
; pp
++)
*(mstr
+ strlen(mstr
) - 1) = 's';
for (pp
= facc
; pp
->s
; pp
++)
*(mstr
+ strlen(mstr
) - 1) = 's';
for (pp
= facc
; pp
->s
; pp
++)
*(rindex(s
, ':')) = '\0';
static char buf
[512], *bp
;
mode2str(rfa
->ri_mode
, bp
);
sprintf(bp
, " %3.3s", status2str(rfa
->ri_status
));
if(IS_LOCKED(rfa
->ri_status
)) {
sprintf(bp
, " lockby %-10s %8d", rfa
->ri_lckname
, rfa
->ri_size
);
sprintf(bp
, " %-8s %-8s %8d", rfa
->ri_owner
, rfa
->ri_group
,
sprintf(bp
, " %12s", shortTime(&(rfa
->ri_modTime
)));
sprintf(bp
, " %s", rfa
->ri_filename
);
if ((rfa
->ri_mode
& S_IFMT
) == S_IFLNK
) {
sprintf(bp
, " -> %s", rfa
->ri_lnkName
);