<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-7182371568763719854.post5234431233564469397..comments</id><updated>2011-06-16T16:22:31.233-07:00</updated><title type='text'>Comments on Step Three: Profit!: Cross-Platform Monitoring of Filesystem Events</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.stepthreeprofit.com/feeds/5234431233564469397/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html'/><author><name>blanu</name><uri>http://www.blogger.com/profile/10742095104796078540</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-4006825196659156818</id><published>2011-06-16T16:22:31.233-07:00</published><updated>2011-06-16T16:22:31.233-07:00</updated><title type='text'>I know its been a while, but I&amp;#39;m really intere...</title><content type='html'>I know its been a while, but I&amp;#39;m really interested in your cross-platform code for my own open source project. Even if its raw cr*p code, it would be helpful. Can you post it?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/4006825196659156818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/4006825196659156818'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1308266551233#c4006825196659156818' title=''/><author><name>Simon</name><uri>http://www.blogger.com/profile/12522652313874884396</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-444564443'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-7865242770832210697</id><published>2010-11-19T02:45:58.822-08:00</published><updated>2010-11-19T02:45:58.822-08:00</updated><title type='text'>I&amp;#39;m working on a Python library that attempts ...</title><content type='html'>I&amp;#39;m working on a Python library that attempts to monitor file system events on operating systems and uses the native APIs as much as possible before resorting to polling the disk as a fallback.&lt;br /&gt;&lt;br /&gt;Check it out here:&lt;br /&gt;http://github.com/gorakhargosh/watchdog/</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/7865242770832210697'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/7865242770832210697'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1290163558822#c7865242770832210697' title=''/><author><name>Gora</name><uri>http://www.blogger.com/profile/07932596911076477078</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-352232983'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-8628949879508913195</id><published>2009-08-26T14:09:07.374-07:00</published><updated>2009-08-26T14:09:07.374-07:00</updated><title type='text'>Me too. I would like to play with the source as we...</title><content type='html'>Me too. I would like to play with the source as well.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/8628949879508913195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/8628949879508913195'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1251320947374#c8628949879508913195' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1456734967'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-29263957784002128</id><published>2009-06-19T13:10:24.734-07:00</published><updated>2009-06-19T13:10:24.734-07:00</updated><title type='text'>Is there any update on the code being published fo...</title><content type='html'>Is there any update on the code being published for this? Thanks :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/29263957784002128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/29263957784002128'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1245442224734#c29263957784002128' title=''/><author><name>phobis</name><uri>http://www.blogger.com/profile/17157331871852914049</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1794084638'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-6215291658020225033</id><published>2009-01-07T15:06:00.000-08:00</published><updated>2009-01-07T15:06:00.000-08:00</updated><title type='text'>Did you ever release this code?</title><content type='html'>Did you ever release this code?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/6215291658020225033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/6215291658020225033'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1231369560000#c6215291658020225033' title=''/><author><name>swaits</name><uri>http://www.blogger.com/profile/14510800937774723175</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-219005366'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-8290925882924267902</id><published>2008-12-10T18:24:00.000-08:00</published><updated>2008-12-10T18:24:00.000-08:00</updated><title type='text'>inotify, using pyinotify, can also do recursive wa...</title><content type='html'>inotify, using pyinotify, can also do recursive watches, though it's not on by default.  You just have to pass rec=True to the add_watch function of the watch manager (also, probably auto_add=True, if you want newly created subdirectories to be automatically monitored).&lt;BR/&gt;&lt;BR/&gt;In any event, I'm working on some code that, for the moment, depends on pyinotify and is thus Linux-specific, but that I wouldn't mind making cross-platform, so I'm very much interested in your progress.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/8290925882924267902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/8290925882924267902'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1228962240000#c8290925882924267902' title=''/><author><name>Andrew Pendleton</name><uri>http://www.blogger.com/profile/12130268974611649068</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1241830831'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-5897723186861201828</id><published>2008-11-07T02:10:00.000-08:00</published><updated>2008-11-07T02:10:00.000-08:00</updated><title type='text'>MMh. On OS X you also don't have to watch every di...</title><content type='html'>MMh. On OS X you also don't have to watch every directory:&lt;BR/&gt;FSEvents.h doesn't have the kqueue's problem.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/5897723186861201828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/5897723186861201828'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1226052600000#c5897723186861201828' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1520677976'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-4217259381201272318</id><published>2008-10-03T09:26:00.000-07:00</published><updated>2008-10-03T09:26:00.000-07:00</updated><title type='text'>Ringlight is launching a public beta this month. I...</title><content type='html'>Ringlight is launching a public beta this month. It will take some time after that to package the filesystem monitoring component into a usable library. I'll keep you updated!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/4217259381201272318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/4217259381201272318'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1223051160000#c4217259381201272318' title=''/><author><name>blanu</name><uri>http://www.blogger.com/profile/10742095104796078540</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1063577450'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-8387534306658358751</id><published>2008-10-01T19:19:00.000-07:00</published><updated>2008-10-01T19:19:00.000-07:00</updated><title type='text'>"I am planning on release the filesystem monitorin...</title><content type='html'>"I am planning on release the filesystem monitoring core of the Ringlight client as open source, as there are no good cross-platform filesystem monitoring libraries available and it's really a shame that people have to reimplement all of this for their applications."&lt;BR/&gt;&lt;BR/&gt;That is somthing I would love to see. It is very interesting, and yes, there  is very little out there. Any chance of a sneak peak?&lt;BR/&gt;&lt;BR/&gt;Pete</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/8387534306658358751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/8387534306658358751'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1222913940000#c8387534306658358751' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1344480212'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-85013378284854557</id><published>2008-06-10T12:57:00.000-07:00</published><updated>2008-06-10T12:57:00.000-07:00</updated><title type='text'>Hi Jim, thanks for taking the time to leave a comm...</title><content type='html'>Hi Jim, thanks for taking the time to leave a comment.&lt;BR/&gt;&lt;BR/&gt;I do in fact use ReadDirectoryChangeW() on Windows, which is part of the Python for Windows Extensions that I mention in the article. You are correct that my bullet point regarding a lack of recursive monitoring doesn't hold on Windows. (Thanks, Windows!)&lt;BR/&gt;&lt;BR/&gt;However, the problem with symlinks (or in the case of Windows, shortcuts) does apply to Windows. If you register a directory tree and the directory contains a shortcut to a subdirectory to somewhere else (not contained in the directory tree), you will not receive events when the contents of the subdirectory change. I understand that your point is that one approach is to just monitor the entire filesystem. So this particular point is of more importance if you are only monitoring part of the filesystem (for instance, one directory, perhaps a "hot folder"). While you could achieve this by monitoring the whole filesystem, and simply discarding events not relating to the hot folder, you do need to do some extra bookkeeping to match events on shortcut destination folders as relevant.&lt;BR/&gt;&lt;BR/&gt;Thanks for the tip regarding supporting USB storage devices properly on Windows. I had not thought of that, and it is very useful!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/85013378284854557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/85013378284854557'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1213127820000#c85013378284854557' title=''/><author><name>blanu</name><uri>http://www.blogger.com/profile/10742095104796078540</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1063577450'/></entry><entry><id>tag:blogger.com,1999:blog-7182371568763719854.post-3210794869233977162</id><published>2008-06-06T11:47:00.000-07:00</published><updated>2008-06-06T11:47:00.000-07:00</updated><title type='text'>You are quite incorrect about several of your clai...</title><content type='html'>You are quite incorrect about several of your claims regarding problems with filesystem monitoring.  Having written a couple of such cross-platform tools in Python over the years you apparently need to do a bit more digging.&lt;BR/&gt;&lt;BR/&gt;Since it is the dominant platform at the moment I will outline some of the issues you need to deal with on win32.  For starters, check up on Tim Golden's example wrappers for ReadDirectoryChangesW().  This is what you will need to use for windows to grab filesystem changes.  And yes, you can monitor an entire disk using a single call to ReadDirectoryChangesW (which eliminates your problems regarding symlinks/aliases.)&lt;BR/&gt;&lt;BR/&gt;&lt;BR/&gt;What you will need to modify in the example code is to change the call to ReadDirectoryChangesW to one that uses an io completion port so that your watcher thread is not blocked waiting for a filesystem event to occur (this will cause some of the watchers on filesystems that do not change much to be hard to kill, as you will have to wait for an event to fire before the call will return.)  Once you have the wrappers tweaked so that you can kill watcher threads at will you will need to add support to detect insertion and removal request for usb devices.  You will need to add a message hook for WM_DEVICECHANGE notification so that when the user requests usb device removal you can kill your watcher thread and then pass the device change notice along.  Without this you will effectively lock a usb device as soon as you put a watcher on it because the request for device removal will be killed by the open filehandle you have in the ReadDirectoryChangesW call.  What gets tricky about catching the WM_DEVICECHANGE hook is that you have to run this particular windows message pump in the main thread of your application (and run all other event loops in sub-threads) or else windows will never hand it the device change notifications.&lt;BR/&gt;&lt;BR/&gt;It is ugly all the way down here, but once you get the basics working it is really easy to have a large batch of threads watching entire drives and throwing the events they catch into a queue for another thread to process. Matching rename_from and rename_to messages it a bit of a PITA, but not too painful considering all of the other contortions necessary to get that basic filesystem watcher code working.&lt;BR/&gt;&lt;BR/&gt;The various threads to do the filesystem watching consume very little CPU and once you have a good filesystem watcher working you will need to rescan the disk a lot less frequently.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/3210794869233977162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7182371568763719854/5234431233564469397/comments/default/3210794869233977162'/><link rel='alternate' type='text/html' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html?showComment=1212778020000#c3210794869233977162' title=''/><author><name>Jim</name><uri>http://www.blogger.com/profile/10393180360599397126</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.stepthreeprofit.com/2008/06/cross-platform-monitoring-of-filesystem.html' ref='tag:blogger.com,1999:blog-7182371568763719854.post-5234431233564469397' source='http://www.blogger.com/feeds/7182371568763719854/posts/default/5234431233564469397' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-36492442'/></entry></feed>
