文件操作 - staticfilesnmp.py
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/doc/uwsgi-core/examples/staticfilesnmp.py
编辑文件内容
import uwsgi from os import path uwsgi.snmp_set_counter64(1, 0) # Number of requests uwsgi.snmp_set_counter64(2, 0) # Number of bytes def application(environ, start_response): size = path.getsize('logo_uWSGI.png') start_response('200 OK', [('Content-Type', 'image/png'), ('Content-Length', str(size))] ) fd = open('logo_uWSGI.png','r') uwsgi.snmp_incr_counter64(1) uwsgi.snmp_incr_counter64(2, size) return environ['wsgi.file_wrapper'](fd, 4096)
修改文件时间
将文件时间修改为当前时间的前一年
删除文件