0

I want to write a python script which will keep track while transferring data from external USB to hard disk , I want to track the location of the data being transferred and the time at which the Process ends .(Through CLI) .

I have searched many places on internet but found nothing relevant. Any idea how can I start?

  • Possible duplicate of [How to check in python that a file in a folder has changed?](http://stackoverflow.com/questions/12582720/how-to-check-in-python-that-a-file-in-a-folder-has-changed) – Martin Tournoij Dec 09 '16 at 23:05

1 Answers1

1

There is actually a piece in the kernel that can monitor accesses to the filesystem and "notify" other processes whenever it happens

It is exported to c libraries, it is exported to python (and even bash!).

You can then find the other files that process access using:

lsof -p <PID>
I-V
  • 725
  • 4
  • 10