RE: [ZEND-ENGINE-CVS] cvs: TSRM(PHP_5_2) / tsrm_virtual_cwd.c tsrm_virtual_cwd.h php-src NEWS

From: Date: Fri, 10 Nov 2006 18:56:43 +0000
Subject: RE: [ZEND-ENGINE-CVS] cvs: TSRM(PHP_5_2) / tsrm_virtual_cwd.c tsrm_virtual_cwd.h php-src NEWS
References: 1  Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-5400@lists.php.net to get a copy of this message
:) Yeah they are using FindFirstFile() which is *extremely* slow (about 2.5x slower). Maybe they didn't want to have two code paths for Win 95 and newer Windows systems. In PHP, we already dumped Win 95 support a while ago (for PHP 5). Andi > -----Original Message----- > From: Nuno Lopes [mailto:nlopess@php.net] > Sent: Friday, November 10, 2006 9:06 AM > To: Dmitry Stogov; 'Wez Furlong' > Cc: zend-engine-cvs@lists.php.net > Subject: Re: [ZEND-ENGINE-CVS] cvs: TSRM(PHP_5_2) / > tsrm_virtual_cwd.c tsrm_virtual_cwd.h php-src NEWS > > okok, I was just thinking loud. > BTW, you could send you patch to Microsoft :P > > Nuno > > > ----- Original Message ----- > > The original Microsoft implementation of stat() doesn't > look for NTFS > > attributes. > > So my patch breaks nothing. > > > > Dmitry. > > > >> -----Original Message----- > >> From: Nuno Lopes [mailto:nlopess@php.net] > >> Sent: Friday, November 10, 2006 7:05 PM > >> To: Wez Furlong > >> Cc: Dmitry Stogov; zend-engine-cvs@lists.php.net > >> Subject: Re: [ZEND-ENGINE-CVS] cvs: TSRM(PHP_5_2) / > >> tsrm_virtual_cwd.c tsrm_virtual_cwd.h php-src NEWS > >> > >> > >> Aaah ok. > >> Thanks for the explanation, > >> Nuno > >> > >> ----- Original Message ----- > >> > NTFS uses ACLs which are different from file modes. > They are much > >> > more expensive to obtain, and do not mean the same thing. > >> If we want > >> > to support ACLs, we should provide an API that works with > >> both POSIX > >> > and NTFS systems. > >> > > >> > --Wez. > >> > > >> > On 11/10/06, Nuno Lopes <nlopess@php.net> wrote: > >> >> Hi Dmitry, > >> >> > >> >> Glad to see your commits :) > >> >> > >> >> > >> >> > + buf->st_uid = buf->st_gid = buf->st_ino = 0; st_mode = > >> >> > + buf->(data.dwFileAttributes & > >> FILE_ATTRIBUTE_DIRECTORY) > >> >> > + buf->? > >> >> > (S_IFDIR|S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)) : S_IFREG; > >> >> > + buf->st_mode |= (data.dwFileAttributes & > >> FILE_ATTRIBUTE_READONLY) > >> >> > + buf->? > >> >> > (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)) : > >> >> > > >> (S_IREAD|(S_IREAD>>3)|(S_IREAD>>6)|S_IWRITE|(S_IWRITE>>3)|(S_IWRITE > >> >> > >>6)); > >> >> > + if ((data.dwFileAttributes & > FILE_ATTRIBUTE_DIRECTORY) == 0) { > >> >> > + int len = strlen(path); > >> >> > + > >> >> > + if (path[len-4] == '.') { > >> >> > + if (_memicmp(path+len-3, "exe", 3) == 0 || > >> >> > + _memicmp(path+len-3, "com", 3) == 0 || > >> >> > + _memicmp(path+len-3, "bat", 3) == 0 || > >> >> > + _memicmp(path+len-3, "cmd", 3) == 0) { > >> >> > + buf->st_mode |= (S_IEXEC|(S_IEXEC>>3)|(S_IEXEC>>6)); > >> >> > + } > >> >> > + } > >> >> > + } > >> >> > >> >> This logic is correct with FAT, but probably not with > NTFS as NTFS > >> >> supports an execute attribute, which you aren't using > here. Also, > >> you are giving > >> >> the > >> >> same permissions for owner/group/user, but again, with > >> NTFS this is not > >> >> true > >> >> at all. > >> >> However I navigated through the MSDN site and I > couldn't find any > >> >> function to retrieve these NTFS attributes. Anyway, I hope you > >> understand my > >> >> point. > >> >> > >> >> > >> >> Nuno > > -- > Zend Engine CVS Mailing List (http://cvs.php.net/) To > unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.zend-engine.cvs (#5400) next »