How To print the files older than some x days | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

How To print the files older than some x days

Using Python Language Only

27th Jan 2017, 7:17 AM
Gopikrishna A
Gopikrishna A - avatar
2 Respostas
+ 1
Try to use os module and os.stat - you need to find ctime of file - this is a time when file have been created (but only for Unix-like os), then get time for now in unixtime: from time import time, and then: if (time() - ctime)/86400 > x then you need print this filename.
29th Jan 2017, 10:31 AM
Š˜Š³Š¾Ń€ŃŒ Š¢ŠøрсŠŗŠøŠ¹
Š˜Š³Š¾Ń€ŃŒ Š¢ŠøрсŠŗŠøŠ¹ - avatar
0
thank u..
29th Jan 2017, 10:55 AM
Gopikrishna A
Gopikrishna A - avatar