104 @return list of tuples containing the entry name and the associated |
104 @return list of tuples containing the entry name and the associated |
105 stat() tuple |
105 stat() tuple |
106 @rtype list of tuple of (str, tuple) |
106 @rtype list of tuple of (str, tuple) |
107 """ |
107 """ |
108 try: |
108 try: |
109 if dirname: |
109 files = os.listdir(dirname) if dirname else os.listdir() |
110 files = os.listdir(dirname) |
|
111 else: |
|
112 files = os.listdir() |
|
113 except OSError: |
110 except OSError: |
114 return [] |
111 return [] |
115 |
112 |
116 if dirname in ('', '/'): |
113 if dirname in ('', '/'): |
117 return [(f, fstat(f)) for f in files if isVisible(f, showHidden)] |
114 return [(f, fstat(f)) for f in files if isVisible(f, showHidden)] |