0

How do I detect a particular file in a folder as soon as they are created in the folder?

first i create a particular file and read a value from that file then i delete that file. next time i create a file in same folder with the same name but the value in that file may be different. so my aim is to read the value in that file as soon as it is created in the folder.

can anyone help me?

  • 1
    It is possible to do this, but the solution is likely to be different for different OSes. Which OS are you using? [watchdog](https://pypi.python.org/pypi/watchdog) is a wrapper around some of the OS issues, but may be too resource intensive if you plan to run it on a Raspberry Pi. Does the watching need to be instantaneous? – musically_ut Oct 26 '15 at 15:51
  • Are there two different programs involved? What OS? What you are describing seems a little fragile. – dawg Oct 26 '15 at 15:53
  • See: [detect new or modified files with python](http://stackoverflow.com/questions/1618853/detect-new-or-modified-files-with-python). – agold Oct 26 '15 at 15:54
  • I'm doing this in raspberry pi so raspian os i installed – Biruntha Gnaneswaran Oct 26 '15 at 16:59
  • Or help me to continuously track a folder has a file (possibility is one file or no files ). as soon as a file created in that folder i want to do some action. – Biruntha Gnaneswaran Oct 27 '15 at 01:06

0 Answers0