Exemplo n.º 1
0
 def remove(self, path):
     try:
         res = os.remove(path)
     except (OSError, IOError) as e:
         raise PathTreeError(
             f'Synamic File System Error (occurred during remove on path: {path}):\n'
             f'{str(e)}')
     return res
Exemplo n.º 2
0
 def open(self, path, *args, **kwargs):
     try:
         fo = open(path, *args, **kwargs)
     except (OSError, IOError) as e:
         raise PathTreeError(
             f'Synamic File System Error (occurred during opening path {path}):\n'
             f'{str(e)}')
     return fo
Exemplo n.º 3
0
 def makedirs(self, path):
     try:
         res = os.makedirs(path)
     except (OSError, IOError) as e:
         raise PathTreeError(
             f'Synamic File System Error (occurred during making directory with path: {path}):\n'
             f'{str(e)}')
     return res
Exemplo n.º 4
0
 def listdir(self, path):
     try:
         res = os.listdir(path)
     except (OSError, IOError) as e:
         raise PathTreeError(
             f'Synamic File System Error (occurred during listing path: {path}):\n'
             f'{str(e)}')
     return res
Exemplo n.º 5
0
 def is_dir(self, path):
     try:
         res = os.path.isdir(path)
     except (OSError, IOError) as e:
         raise PathTreeError(
             f'Synamic File System Error (occurred during checking if the path is a directory path {path}):\n'
             f'{str(e)}')
     return res
Exemplo n.º 6
0
 def exists(self, path):
     try:
         res = os.path.exists(path)
     except (OSError, IOError) as e:
         raise PathTreeError(
             f'Synamic File System Error (occurred during exists() on path {path}):\n'
             f'{str(e)}')
     return res