@@ -83,14 +83,14 @@ def stat(self, follow_symlinks=True):
83
83
"""
84
84
if follow_symlinks :
85
85
if self ._statresult_symlink is None :
86
- file_object = self ._filesystem .ResolveObject (self .path )
86
+ file_object = self ._filesystem .resolve (self .path )
87
87
if self ._filesystem .is_windows_fs :
88
88
file_object .st_nlink = 0
89
89
self ._statresult_symlink = file_object .stat_result .copy ()
90
90
return self ._statresult_symlink
91
91
92
92
if self ._statresult is None :
93
- file_object = self ._filesystem .LResolveObject (self .path )
93
+ file_object = self ._filesystem .lresolve (self .path )
94
94
self ._inode = file_object .st_ino
95
95
if self ._filesystem .is_windows_fs :
96
96
file_object .st_nlink = 0
@@ -106,14 +106,15 @@ def __init__(self, filesystem, path):
106
106
self .filesystem = filesystem
107
107
if isinstance (path , int ):
108
108
if sys .version_info < (3 , 7 ) or self .filesystem .is_windows_fs :
109
- raise NotImplementedError ('scandir does not support file descriptor'
110
- 'path argument' )
109
+ raise NotImplementedError (
110
+ 'scandir does not support file descriptor '
111
+ 'path argument' )
111
112
path = self .filesystem .get_open_file (path ).get_object ().path
112
113
113
- self .path = self .filesystem .ResolvePath (path )
114
+ self .path = self .filesystem .absnormpath (path )
114
115
contents = {}
115
116
try :
116
- contents = self .filesystem .ConfirmDir (path ).contents
117
+ contents = self .filesystem .confirmdir (path ).contents
117
118
except OSError :
118
119
pass
119
120
self .contents_iter = iter (contents )
@@ -128,9 +129,10 @@ def __next__(self):
128
129
entry = self .contents_iter .__next__ ()
129
130
dir_entry = DirEntry (self .filesystem )
130
131
dir_entry .name = entry
131
- dir_entry .path = self .filesystem .JoinPaths (self .path , dir_entry .name )
132
- dir_entry ._isdir = self .filesystem .IsDir (dir_entry .path )
133
- dir_entry ._islink = self .filesystem .IsLink (dir_entry .path )
132
+ dir_entry .path = self .filesystem .joinpaths (self .path ,
133
+ dir_entry .name )
134
+ dir_entry ._isdir = self .filesystem .isdir (dir_entry .path )
135
+ dir_entry ._islink = self .filesystem .islink (dir_entry .path )
134
136
return dir_entry
135
137
136
138
# satisfy both Python 2 and 3
@@ -184,8 +186,8 @@ def _classify_directory_contents(filesystem, root):
184
186
"""
185
187
dirs = []
186
188
files = []
187
- for entry in filesystem .ListDir (root ):
188
- if filesystem .IsDir (filesystem .JoinPaths (root , entry )):
189
+ for entry in filesystem .listdir (root ):
190
+ if filesystem .isdir (filesystem .joinpaths (root , entry )):
189
191
dirs .append (entry )
190
192
else :
191
193
files .append (entry )
@@ -213,7 +215,7 @@ def walk(filesystem, top, topdown=True, onerror=None, followlinks=False):
213
215
214
216
def do_walk (top_dir , top_most = False ):
215
217
top_dir = filesystem .CollapsePath (top_dir )
216
- if not top_most and not followlinks and filesystem .IsLink (top_dir ):
218
+ if not top_most and not followlinks and filesystem .islink (top_dir ):
217
219
return
218
220
try :
219
221
top_contents = _classify_directory_contents (filesystem , top_dir )
@@ -227,9 +229,10 @@ def do_walk(top_dir, top_most=False):
227
229
yield top_contents
228
230
229
231
for directory in top_contents [1 ]:
230
- if not followlinks and filesystem .IsLink (directory ):
232
+ if not followlinks and filesystem .islink (directory ):
231
233
continue
232
- for contents in do_walk (filesystem .JoinPaths (top_dir , directory )):
234
+ for contents in do_walk (filesystem .joinpaths (top_dir ,
235
+ directory )):
233
236
yield contents
234
237
235
238
if not topdown :
0 commit comments