def format_prefix(filename, sres):
try:<EOL><INDENT>pwent = pwd.getpwuid(sres.st_uid)<EOL>user = pwent.pw_name<EOL><DEDENT>except KeyError:<EOL><INDENT>user = sres.st_uid<EOL><DEDENT>try:<EOL><INDENT>grent = grp.getgrgid(sres.st_gid)<EOL>group = grent.gr_name<EOL><DEDENT>except KeyError:<EOL><INDENT>group = sres.st_gid<EOL><DEDENT>return '<STR_LIT>' % (<EOL>format_mode(sres),<EOL>sres.st_nlink,<EOL>user,<EOL>group,<EOL>sres.st_size,<EOL>format_mtime(sres.st_mtime),<EOL>)<EOL>
Prefix to a filename in the directory listing. This is to make the
listing similar to an output of "ls -alh".