def __str__(self):
if self.st_mode is not None:<EOL><INDENT>kind = stat.S_IFMT(self.st_mode)<EOL>if kind == stat.S_IFIFO:<EOL><INDENT>ks = "<STR_LIT:p>"<EOL><DEDENT>elif kind == stat.S_IFCHR:<EOL><INDENT>ks = "<STR_LIT:c>"<EOL><DEDENT>elif kind == stat.S_IFDIR:<EOL><INDENT>ks = "<STR_LIT:d>"<EOL><DEDENT>elif kind == stat.S_IFBLK:<EOL><INDENT>ks = "<STR_LIT:b>"<EOL><DEDENT>elif kind == stat.S_IFREG:<EOL><INDENT>ks = "<STR_LIT:->"<EOL><DEDENT>elif kind == stat.S_IFLNK:<EOL><INDENT>ks = "<STR_LIT:l>"<EOL><DEDENT>elif kind == stat.S_IFSOCK:<EOL><INDENT>ks = "<STR_LIT:s>"<EOL><DEDENT>else:<EOL><INDENT>ks = "<STR_LIT:?>"<EOL><DEDENT>ks += self._rwx(<EOL>(self.st_mode & o700) >> <NUM_LIT:6>, self.st_mode & stat.S_ISUID<EOL>)<EOL>ks += self._rwx(<EOL>(self.st_mode & o70) >> <NUM_LIT:3>, self.st_mode & stat.S_ISGID<EOL>)<EOL>ks += self._rwx(<EOL>self.st_mode & <NUM_LIT:7>, self.st_mode & stat.S_ISVTX, True<EOL>)<EOL><DEDENT>else:<EOL><INDENT>ks = "<STR_LIT>"<EOL><DEDENT>if (self.st_mtime is None) or (self.st_mtime == xffffffff):<EOL><INDENT>datestr = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>if abs(time.time() - self.st_mtime) > <NUM_LIT>:<EOL><INDENT>datestr = time.strftime(<EOL>"<STR_LIT>", time.localtime(self.st_mtime)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>datestr = time.strftime(<EOL>"<STR_LIT>", time.localtime(self.st_mtime)<EOL>)<EOL><DEDENT><DEDENT>filename = getattr(self, "<STR_LIT:filename>", "<STR_LIT:?>")<EOL>uid = self.st_uid<EOL>gid = self.st_gid<EOL>size = self.st_size<EOL>if uid is None:<EOL><INDENT>uid = <NUM_LIT:0><EOL><DEDENT>if gid is None:<EOL><INDENT>gid = <NUM_LIT:0><EOL><DEDENT>if size is None:<EOL><INDENT>size = <NUM_LIT:0><EOL><DEDENT>return "<STR_LIT>" % (<EOL>ks,<EOL>uid,<EOL>gid,<EOL>size,<EOL>datestr,<EOL>filename,<EOL>)<EOL>
create a unix-style long description of the file (like ls -l)