Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70348 invoked from network); 7 Mar 2011 01:15:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Mar 2011 01:15:52 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.183 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.183 smtp183.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.183] ([207.97.245.183:40776] helo=smtp183.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1C/42-49829-7C1347D4 for ; Sun, 06 Mar 2011 20:15:51 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp48.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 17388168A97 for ; Sun, 6 Mar 2011 20:15:49 -0500 (EST) X-Virus-Scanned: OK Received: by smtp48.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id C78C3168A89 for ; Sun, 6 Mar 2011 20:15:48 -0500 (EST) Message-ID: <4D7431C3.10405@sugarcrm.com> Date: Sun, 06 Mar 2011 17:15:47 -0800 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.14) Gecko/20110221 Thunderbird/3.1.8 MIME-Version: 1.0 To: PHP Internals Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: file streams & metadata From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! PHP file streams provide very powerful and useful abstraction layer over the I/O-related functions. However, there's a group of functions which are excluded from this support - namely, touch(), chmod(), chown() and chgrp() - i.e., functions dealing with file metadata. This lead to libraries implementing FS virtualization developing various hacks, such as here: https://code.google.com/p/bovigo/wiki/vfsStreamDocsFilemode I propose to plug this hole in the stream implementation by adding a handler to deal with metadata to stream handlers, such as: int (*stream_set_metadata)(php_stream_wrapper *wrapper, char *url, int metatype, void *metadata TSRMLS_DC); metadata types can be: - access/modification time with touch() semantics or without it - permissions information - owner information by name or number - group information by name or number Of course, there are streams where it doesn't make sense, but there are many application of streams (such as virtualizing real filesystems, mocks, etc.) where this would help a lot with using streams transparently inside applications. Any comments? -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227