Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- from shutil import *
- import os
- import time
- def show_file_info(filename):
- stat_info = os.stat(filename)
- print '\tMode :', stat_info.st_mode
- print '\tCreated :', time.ctime(stat_info.st_ctime)
- print '\tAccessed:', time.ctime(stat_info.st_atime)
- print '\tModified:', time.ctime(stat_info.st_mtime)
- with open('file_to_change.txt', 'wt') as f:
- f.write('content')
- os.chmod('file_to_change.txt', 0444)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement