Add listdir_files, listdir_directories.

This commit is contained in:
voussoir 2021-11-07 18:59:02 -08:00
parent e737e60862
commit 6c063fd187
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -271,6 +271,12 @@ class Path:
children = [self.join(child, _case_correct=self._case_correct) for child in children]
return children
def listdir_directories(self):
return [p for p in self.listdir() if p.is_dir]
def listdir_files(self):
return [p for p in self.listdir() if p.is_file]
def makedirs(self, mode=0o777, exist_ok=False):
return os.makedirs(self.absolute_path, mode=mode, exist_ok=exist_ok)