forked from KEMMY/BC-2012
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtxt_metadata_maker.py
26 lines (19 loc) · 1 KB
/
txt_metadata_maker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
def file_maker(statinfo):
log_file = open("/home/kmm/Plocha/nove/stats.txt",'w')
txt = ""
txt += 'Protection bits : '+ str(statinfo.st_mode) + "\n" #portection bits
txt += "Inode number : "+ str(statinfo.st_ino) + "\n" # Inode number
txt += "Device :" + str(statinfo.st_dev) + "\n" # Zariadenie
txt += "Number of hard links : " + str(statinfo.st_nlink) + "\n" # pocet hardlinkov
txt += "User ID of owner : " + str(statinfo.st_uid) + "\n" # userID
txt += "Group ID of owner : " + str(statinfo.st_gid) + "\n" # Group ID
txt += "Size of file : "+ str(statinfo.st_size) + "\n" # File size
txt += "Time of most recent acces : "+ str(statinfo.st_atime) + "\n"# cas posledneho pristupu
txt += "Time of most recent content modification : "+ str(statinfo.st_mtime) + "\n" # cas poseldnej zmeny
txt += "Platform : " + str(statinfo.st_ctime) + "\n" # Linux or Win
log_file.write(txt)
log_file.close()
x = os.stat("/home/kmm/Plocha/nove")
print x
file_maker(x)