Commit eef9c03a authored by Gero Müller's avatar Gero Müller
Browse files

handle symlinks

parent e4c27a90
......@@ -99,15 +99,18 @@ class FileSystem(object):
fullpath = os.path.join(path_expand, elem)
stats = os.lstat(fullpath)
is_symlink = stat.S_ISLNK(stats.st_mode)
if is_symlink:
stats = os.stat(fullpath)
size = stats.st_size
mtime = stats.st_mtime
if stat.S_ISDIR(stats.st_mode):
filelist.append({'name': elem, 'type': 'd', 'mtime': mtime, 'size': size})
filelist.append({'name': elem, 'symlink': is_symlink, 'type': 'd', 'mtime': mtime, 'size': size})
if deep:
filelist.extend(self.get_file_list(fullpath, deep, filter, reverse))
else:
filelist.append({'name': elem, 'type': 'f', 'mtime': mtime, 'size': size})
filelist.append({'name': elem, 'symlink': is_symlink, 'type': 'f', 'mtime': mtime, 'size': size})
except Exception, e:
filelist.append({'warning': str(e)})
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment