importosimporttimeclassFileObject:"""文件对象"""
def __init__(self, filePath):"""创建FileObject对象
:param filePath: 文件路径"""self.__tree_file_objects =None
self.__scan_depth =None
self.__exists =False
self.__file_path =None
self.__is_file =None
self.__is_dir =None
self._is_link=None
self.__size =None
self.__last_modification_time =None
self.__last_access_time =None
self.__metadata_change_time =None
self.__file_name =None
self.__dir_name =Noneifos.path.exists(filePath):
self.__scan_depth =0
self.__exists =True
self.__file_path =filePath
self.__is_file =os.path.isfile(filePath)
self.__is_dir =os.path.isdir(filePath)
self._is_link=os.path.islink(filePath)
self.__size =os.path.getsize(filePath)
self.__last_modification_time =os.path.getmtime(filePath)
self.__last_access_time =os.path.getatime(filePath)
self.__metadata_change_time =os.path.getctime(filePath)
self.__file_name =os.path.basename(filePath)
self.__dir_name =os.path.dirname(filePath)if self.__is_dir:
sel