文件操作 - source_apport.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/apport/package-hooks/source_apport.py
编辑文件内容
'''Apport package hook for apport itself. This adds /var/log/apport.log and the file listing in /var/crash to the report. ''' # Copyright 2007 Canonical Ltd. # Author: Martin Pitt <martin.pitt@ubuntu.com> from glob import glob import apport.hookutils APPORT_LOG = '/var/log/apport.log' def add_info(report): apport.hookutils.attach_file_if_exists(report, APPORT_LOG, 'ApportLog') reports = glob('/var/crash/*') if reports: report['CrashReports'] = apport.hookutils.command_output( ['stat', '-c', '%a:%u:%g:%s:%y:%x:%n'] + reports)
修改文件时间
将文件时间修改为当前时间的前一年
删除文件