-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTime_Del_File.py
More file actions
30 lines (27 loc) · 787 Bytes
/
Copy pathTime_Del_File.py
File metadata and controls
30 lines (27 loc) · 787 Bytes
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
27
28
29
30
# Scratch
#!/usr/bin/env python3
import os
import datetime
req_path = input("Enter path : ")
if os.path.exists(req_path):
lst_files = os.listdir(req_path)
for files in lst_files:
if os.path.isfile(files):
print(files)
elif os.path.isdir(files):
print("\n",files,"is a directory\n")
else:
print("Invalid path!")
while True:
Ex = input('\nFile name for time : ')
if Ex == "Q":
break
elif os.path.isfile(Ex):
print(os.path.getatime(Ex))
print(os.path.getmtime(Ex))
print(os.path.getctime(Ex))
print("\nFile Size: ",os.path.getsize(Ex),"Bytes")
print(datetime.datetime.fromtimestamp(os.path.getctime(Ex)))
print("\nQ to quit")
else:
print("Invalid Input!")