Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65825 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44954 invoked from network); 14 Feb 2013 14:37:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2013 14:37:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:40357] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EE/89-13268-B86FC115 for ; Thu, 14 Feb 2013 09:36:59 -0500 Received: from Hwhost2.local (unknown [194.57.88.213]) by host1.trois-doubles.net (Postfix) with ESMTPSA id 3FC5C20ADB6 for ; Thu, 14 Feb 2013 15:36:56 +0100 (CET) Message-ID: <511CF687.3060103@hoa-project.net> Date: Thu, 14 Feb 2013 15:36:55 +0100 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <511CEEB1.7040303@hoa-project.net> <213E132C-8E1D-485A-84E6-9FC19133D562@michaelho.com> In-Reply-To: <213E132C-8E1D-485A-84E6-9FC19133D562@michaelho.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] File system watcher/monitoring From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") Hi Mike, On 14/02/13 15:18, Mike Ho wrote: > Just a quick note, FileSystemWatcher in .NET is actually not recommende= d for use by Microsoft. > > It does not guarantee that an event will be raised on every new file or= file mod in a given folder=85 and it's even less determinstic when tryin= g to deal with network share drives. > > Microsoft's own developer blogs usually recommend that people roll thei= r own polling-based solution instead of depending on FileSystemWatcher (g= oogling FileSystemWatcher will yield many many results regarding this). > > I'm not necessarily saying that the overall idea is without merit=85 bu= t it's just that if someone does want to try and implement something like= this on Windows, they should try and avoid whatever Win32 API calls that= FileSystemWatcher uses. Ok, thank you for the note. I didn't look deeply in Windows API, just=20 Mac OS X and Linux for the moment=85 Thank you again. > > --Mike > > On Feb 14, 2013, at 6:03 AM, Ivan Enderlin @ Hoa wrote: > >> Hi internal, >> >> A missing feature in PHP is a file system watcher/monitoring available= for almost all platforms. On Linux, we have inotify (available in PHP th= rough pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in= PHP, since we need ioctl to do that in pure PHP =97and sudo=97, no C ext= ension needed), on FreeBSD, we have FAM, and on Windows, we have FileSyst= emWatcher in .NET. All major platforms have a solution ready to use. >> >> By now, if we didn't use these solutions, we should use a finder (than= ks to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs e= very n seconds and compute a diff with the previous run. This solution wo= rks fine for a small set of files but it can slow for a big one. This is = just a tricky solution, not a proper one. >> >> Possible domains where it is needed: test, CI, log, file transfering, = security etc. >> >> Is it possible to have such a feature landing in PHP (core if karma al= lows it)? or do you want such a feature? >> >> Best regards :-). >> >> --=20 >> Ivan Enderlin >> Developer of Hoa >> http://hoa-project.net/ >> >> PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) >> http://disc.univ-fcomte.fr/ and http://www.inria.fr/ >> >> Member of HTML and WebApps Working Group of W3C >> http://w3.org/ >> >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > --=20 Ivan Enderlin Developer of Hoa http://hoa-project.net/ PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) http://disc.univ-fcomte.fr/ and http://www.inria.fr/ Member of HTML and WebApps Working Group of W3C http://w3.org/