def fileage_handle(self):
self.file_list = []<EOL>self.ok_file = []<EOL>self.warn_file = []<EOL>self.crit_file = []<EOL>status = self.ok<EOL>if self.args.recursion:<EOL><INDENT>self.__file_list = self.__get_folder(self.args.path)<EOL><DEDENT>else:<EOL><INDENT>self.__file_list = self.__get_file(self.args.path)<EOL><DEDENT>self.logger.debug("<STR_LIT>".format(self.__file_list))<EOL>for file_dict in self.__file_list:<EOL><INDENT>self.filename = file_dict.get('<STR_LIT:Name>')<EOL>if self.filename and self.filename != '<STR_LIT:Name>':<EOL><INDENT>self.logger.debug(<EOL>"<STR_LIT>".format(<EOL>self.filename))<EOL>self.file_datetime_string = file_dict.get(<EOL>'<STR_LIT>').split('<STR_LIT:.>')[<NUM_LIT:0>]<EOL>self.file_datetime = datetime.datetime.strptime(<EOL>self.file_datetime_string, '<STR_LIT>')<EOL>self.logger.debug(<EOL>"<STR_LIT>".format(<EOL>self.file_datetime))<EOL>self.current_datetime = self.__get_current_datetime()<EOL>self.logger.debug(<EOL>"<STR_LIT>".format(<EOL>self.current_datetime))<EOL>self.__delta_datetime = self.current_datetime - self.file_datetime<EOL>self.logger.debug(<EOL>"<STR_LIT>".format(<EOL>self.__delta_datetime))<EOL>self.logger.debug(<EOL>"<STR_LIT>".format(<EOL>datetime.timedelta(<EOL>minutes=self.args.warning)))<EOL>self.logger.debug(<EOL>"<STR_LIT>".format(<EOL>datetime.timedelta(<EOL>minutes=self.args.critical)))<EOL>if self.__delta_datetime > datetime.timedelta(<EOL>minutes=self.args.critical):<EOL><INDENT>self.crit_file.append(self.filename)<EOL><DEDENT>elif self.__delta_datetime > datetime.timedelta(minutes=self.args.warning):<EOL><INDENT>self.warn_file.append(self.filename)<EOL><DEDENT>else:<EOL><INDENT>self.ok_file.append(self.filename)<EOL><DEDENT><DEDENT><DEDENT>if self.crit_file:<EOL><INDENT>status = self.critical<EOL><DEDENT>elif self.warn_file:<EOL><INDENT>status = self.warning<EOL><DEDENT>else:<EOL><INDENT>status = self.ok<EOL><DEDENT>self.shortoutput = "<STR_LIT>".format(<EOL>len(self.crit_file))<EOL>if self.crit_file:<EOL><INDENT>self.longoutput.append("<STR_LIT>")<EOL><DEDENT>[self.longoutput.append(filename)<EOL>for filename in self.crit_file if self.crit_file]<EOL>if self.warn_file:<EOL><INDENT>self.longoutput.append("<STR_LIT>")<EOL><DEDENT>[self.longoutput.append(filename)<EOL>for filename in self.warn_file if self.warn_file]<EOL>if self.ok_file:<EOL><INDENT>self.longoutput.append("<STR_LIT>")<EOL><DEDENT>[self.longoutput.append(filename)<EOL>for filename in self.ok_file if self.ok_file]<EOL>self.perfdata.append("<STR_LIT>".format(<EOL>crit=self.args.critical,<EOL>warn=self.args.warning,<EOL>result=len(self.crit_file),<EOL>path=self.args.drive + self.args.path))<EOL>status(self.output(long_output_limit=None))<EOL>self.logger.debug("<STR_LIT>")<EOL>
Get the number of file in the folder.