Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:91044 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 39265 invoked from network); 1 Feb 2016 10:03:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Feb 2016 10:03:24 -0000 Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:43435] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 18/06-07168-B6D2FA65 for ; Mon, 01 Feb 2016 05:03:24 -0500 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id 1C6BC785404; Mon, 1 Feb 2016 11:03:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on h1123647.serverkompetenz.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.5 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from w530phpdev (p579F3E83.dip0.t-ipconnect.de [87.159.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id E56B0785402; Mon, 1 Feb 2016 11:03:17 +0100 (CET) To: "'Dmitry Stogov'" , Cc: "'Pierre Joye'" , "'Xinchen Hui'" , "'Nikita Popov'" References: <03ca01d159da$fe2d76b0$fa886410$@belski.net> <56AF2410.3090009@zend.com> In-Reply-To: <56AF2410.3090009@zend.com> Date: Mon, 1 Feb 2016 11:03:14 +0100 Message-ID: <006301d15cd7$c60fe6f0$522fb4d0$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHc/OH61fGL/otFQ0yoa3ZjD19IYAFPI2IinvU4JCA= Content-Language: en-us Subject: RE: [PHP-DEV] Re: Streams and I/O refactoring approach From: anatol.php@belski.net ("Anatol Belski") Hi Dmitry, Many thanks for the comments. > -----Original Message----- > From: Dmitry Stogov [mailto:dmitry@zend.com] > Sent: Monday, February 1, 2016 10:23 AM > To: Anatol Belski ; internals@lists.php.net > Cc: 'Pierre Joye' ; 'Xinchen Hui' > ; 'Nikita Popov' > Subject: [PHP-DEV] Re: Streams and I/O refactoring approach > > Hi, > > At current state, I see this not as a whole stream layer refactoring, but as a low- > level replacement of POSIX layer on Windows. > I see only few "visible" changes: > Basically it's the result of analyzing the code of particularly APR, libuv and several other projects. While libuv works with UTF-8 paths only, APR retains a wider compatibility. Please check the code here for an example https://github.com/apache/apr/blob/trunk/file_io/win32/open.c#L321 > 1. The layer first checks, if file names are valid UTF-8 strings, and use UTF-8 > names or fall back to system locale. Yep, it is done for the fallback, and also the non-unicode part is conditional, so can be turned off on compilation time with PHP_WIN32_IOUTIL_ANSI_COMPAT_MODE set to 0. For an example how it is done in APR https://github.com/apache/apr/blob/trunk/file_io/win32/open.c#L406 Currently it would make sense to keep this fallback, so the current scripts/codes using non-unicode would keep to work. > 2. The patch allows to use long file names (longer than MAX_PATH) using > "//?/******" Yep, to do is to prepend \\?\ transparently for the user. But even without \\?\ multibyte paths are supported. > 3. Files now are opened in FILE_SHARE_READ | FILE_SHARE_WRITE | > FILE_SHARE_DELETE mode (I'm not sure about intended better POSIX > compliance and possible side effects). > This is done in most projects, fe https://github.com/apache/apr/blob/trunk/file_io/win32/open.c#L346 But we can remove it if there's something wrong. > For me, the approach looks a bit inconsistent, especially the attempt to use the > same string as UTF-8 and then using some code page. > The only difference of my approach to the other projects is that I suggest to keep the POSIX compatible APIs, instead of having a whole scruct describing a filesystem object, fe https://ci.apache.org/projects/httpd/trunk/doxygen/structapr__file__t.html It could be done later, but for now keeping POSIX APIs would be IMHO the simplest solution. And as I've stated, it is just a preparation to have everything at the same base, otherwise further improvements are quite tedious. Regards Anatol