Posts

Showing posts with the label python computer programming file sytem log

Display Last Changed Lines in Multiple Files - Python

Image
This is my first English entry. Hereafter, i will write my blog English and Turkish. It depends on my mood :) Recently i need to see some product audit logs. However it was saving logs rule and day based folder and file type. There is defined formats for name of files but it is impossible to guess before. Since it was based on ip address or rule n umber, sth like that. Thus, i needed to check all files that has modified. getListofFiles: Checks all the files under directory that has been inserted to list or removed by process of writing changed lines. This method prepares filesInfo list which is list of list. Internal list contains one file information. Structure: [[filename, last modified time, last read cursor], [.., ..., ...], ..., ...] for example: [['D:\\deneme\\a.txt', 128144 0914.110132, 24L], ['D:\\deneme\\basarili.txt', 1281440962.4076252, 46L], ['D:\\deneme\\t.txt', 1281427352.245864, 32L], ['D:\\deneme\\abc\\1.txt', 1281440315.2405622, 51L], [...