Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65823 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41972 invoked from network); 14 Feb 2013 14:30:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2013 14:30:26 -0000 Received: from [127.0.0.1] ([127.0.0.1:28321]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id A9/E8-13268-205FC115 for ; Thu, 14 Feb 2013 09:30:26 -0500 Authentication-Results: pb1.pair.com smtp.mail=mike@michaelho.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=mike@michaelho.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain michaelho.com from 209.85.160.51 cause and error) X-PHP-List-Original-Sender: mike@michaelho.com X-Host-Fingerprint: 209.85.160.51 mail-pb0-f51.google.com Received: from [209.85.160.51] ([209.85.160.51:49802] helo=mail-pb0-f51.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/08-13268-522FC115 for ; Thu, 14 Feb 2013 09:18:14 -0500 Received: by mail-pb0-f51.google.com with SMTP id un15so177415pbc.38 for ; Thu, 14 Feb 2013 06:18:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:content-type:message-id:mime-version:subject:date :references:to:in-reply-to:x-mailer:x-gm-message-state; bh=vMWxiym3B+at1XxIE6/y/v7IfUwjA+DLrqs45d2tpXY=; b=lTH9Xrd8Dc9Sih99klfBZS3YC8wNq7dTIJgzisI8EN9q3theKWhZX+vW/1325LCJPe HycVunWf8BLMw+5vnmbG+YtR4FOJwDYfg50BpiKkc5s9dcoQiD0XjhVOsMNGt2jGT4pp 32cu4jsDgAXZmB8VvlF24TlV26NE0VwfR6mwRL47WHGrnX2QhG7IzscmM50ba65vIMFe 6KF4NbarYgUDWPv5lDkLipSVtDiKbfGrzwNS4ahJ+foTE6MsFhgS5YBlciZ9pOCwp2eF jvnSB/aDCo+lMj4xO5/51LezYpC+nG1eVxdtI+qHNgUyNKMVYyNOwO+IbnzncmcTvJ0c LSpA== X-Received: by 10.66.72.201 with SMTP id f9mr4330292pav.38.1360851489787; Thu, 14 Feb 2013 06:18:09 -0800 (PST) Received: from [192.168.0.102] (114-40-197-236.dynamic.hinet.net. [114.40.197.236]) by mx.google.com with ESMTPS id d1sm90223930pav.6.2013.02.14.06.18.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 06:18:08 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_44B1A554-1021-48E1-A8C6-6A96F80AEE50" Message-ID: <213E132C-8E1D-485A-84E6-9FC19133D562@michaelho.com> Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Date: Thu, 14 Feb 2013 06:18:03 -0800 References: <511CEEB1.7040303@hoa-project.net> To: PHP internals In-Reply-To: <511CEEB1.7040303@hoa-project.net> X-Mailer: Apple Mail (2.1499) X-Gm-Message-State: ALoCoQmbyv/GEp1WVzcf0g9iiXduSyPCjoBT2oppHjHfdJH50Oreifn2vqSd6u2Z+9R+X1SPhfUd Subject: Re: [PHP-DEV] File system watcher/monitoring From: mike@michaelho.com (Mike Ho) --Apple-Mail=_44B1A554-1021-48E1-A8C6-6A96F80AEE50 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Just a quick note, FileSystemWatcher in .NET is actually not recommended = 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 = trying to deal with network share drives. Microsoft's own developer blogs usually recommend that people roll their = own polling-based solution instead of depending on FileSystemWatcher = (googling FileSystemWatcher will yield many many results regarding = this). I'm not necessarily saying that the overall idea is without merit=85 but = 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. --Mike On Feb 14, 2013, at 6:03 AM, Ivan Enderlin @ Hoa = wrote: > Hi internal, >=20 > A missing feature in PHP is a file system watcher/monitoring available = for almost all platforms. On Linux, we have inotify (available in PHP = through 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 = extension needed), on FreeBSD, we have FAM, and on Windows, we have = FileSystemWatcher in .NET. All major platforms have a solution ready to = use. >=20 > By now, if we didn't use these solutions, we should use a finder = (thanks to RecursiveIteratorIterator and DirectoryIterator in SPL) that = runs every n seconds and compute a diff with the previous run. This = solution works 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. >=20 > Possible domains where it is needed: test, CI, log, file transfering, = security etc. >=20 > Is it possible to have such a feature landing in PHP (core if karma = allows it)? or do you want such a feature? >=20 > Best regards :-). >=20 > --=20 > Ivan Enderlin > Developer of Hoa > http://hoa-project.net/ >=20 > PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis) > http://disc.univ-fcomte.fr/ and http://www.inria.fr/ >=20 > Member of HTML and WebApps Working Group of W3C > http://w3.org/ >=20 >=20 >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 --Apple-Mail=_44B1A554-1021-48E1-A8C6-6A96F80AEE50--