Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Stig Sæther Bakken
[Zeev Suraski [EMAIL PROTECTED]] Hey, I just got around to writing a PHP script that uses stat(), and was quite surprised to find that instead of using string indices, it uses hardcoded/obscure numeric indices, e.g.: Array ( [0] = 2050 [1] = 1114462 [2] = 16877

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread derick
On 11 May 2001, Stig Sæther Bakken wrote: Why not have both numerical and descriptive indices? Backwards compatible, slightly bloatish, but not really a problem. it's already implemented this way now (it was added last night) AFAIK Derick Rethans

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Zeev Suraski
At 12:18 11/5/2001, Stig Sæther Bakken wrote: [Zeev Suraski [EMAIL PROTECTED]] Hey, I just got around to writing a PHP script that uses stat(), and was quite surprised to find that instead of using string indices, it uses hardcoded/obscure numeric indices, e.g.: Array ( [0]

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
[EMAIL PROTECTED] Sent: Friday, May 11, 2001 10:21 AM Subject: Re: [PHP-DEV] stat/fstat [EMAIL PROTECTED] wrote: On 11 May 2001, Stig Sæther Bakken wrote: Why not have both numerical and descriptive indices? Backwards compatible, slightly bloatish, but not really a problem. it's already

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Andrei Zmievski
On Fri, 11 May 2001, Jason Greene wrote: Its actually not that pretty Since the entries are in a hashtable, you have to duplicate the values, with just another key. You could just reuse the same value with refcount++ but that means you can't use nice add_* functions, gotta use zend_hash_*

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
Andrei had the same suggestion, so I went ahead and added it last night. -Jason - Original Message - From: Stig Sæther Bakken [EMAIL PROTECTED] To: Zeev Suraski [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, May 11, 2001 4:18 AM Subject: Re: [PHP-DEV] stat/fstat [Zeev Suraski

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
On Fri, 11 May 2001, Jason Greene wrote: Its actually not that pretty Since the entries are in a hashtable, you have to duplicate the values, with just another key. You could just reuse the same value with refcount++ but that means you can't use nice add_* functions, gotta use

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Andrei Zmievski
On Fri, 11 May 2001, Jason Greene wrote: True, I was lazy though and didn't feel like writing all that additional code, just to save 13 longs of memory space : ) 13 * sizeof(zval) actually. -Andrei When we eliminate the impossible, whatever remains, however improbable, must be true. --

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
Mailing List [EMAIL PROTECTED] Sent: Friday, May 11, 2001 11:38 AM Subject: Re: [PHP-DEV] stat/fstat On Fri, 11 May 2001, Jason Greene wrote: True, I was lazy though and didn't feel like writing all that additional code, just to save 13 longs of memory space : ) 13 * sizeof(zval) actually

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Zeev Suraski
At 18:21 11/5/2001, Brian Foddy wrote: [EMAIL PROTECTED] wrote: On 11 May 2001, Stig Sæther Bakken wrote: Why not have both numerical and descriptive indices? Backwards compatible, slightly bloatish, but not really a problem. it's already implemented this way now (it was added

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Brian Foddy
Zeev Suraski wrote: At 18:21 11/5/2001, Brian Foddy wrote: [EMAIL PROTECTED] wrote: On 11 May 2001, Stig Sæther Bakken wrote: Why not have both numerical and descriptive indices? Backwards compatible, slightly bloatish, but not really a problem. it's already

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Zeev Suraski
At 19:38 11/5/2001, Andrei Zmievski wrote: On Fri, 11 May 2001, Jason Greene wrote: True, I was lazy though and didn't feel like writing all that additional code, just to save 13 longs of memory space : ) 13 * sizeof(zval) actually. 13*(sizeof(zval)+sizeof(zend_mem_header)), and possibly

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
: [PHP-DEV] stat/fstat At 19:38 11/5/2001, Andrei Zmievski wrote: On Fri, 11 May 2001, Jason Greene wrote: True, I was lazy though and didn't feel like writing all that additional code, just to save 13 longs of memory space : ) 13 * sizeof(zval) actually. 13*(sizeof(zval)+sizeof

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Zeev Suraski
Mailing List [EMAIL PROTECTED] Sent: Friday, May 11, 2001 12:36 PM Subject: Re: [PHP-DEV] stat/fstat At 19:38 11/5/2001, Andrei Zmievski wrote: On Fri, 11 May 2001, Jason Greene wrote: True, I was lazy though and didn't feel like writing all that additional code, just to save 13

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Andrei Zmievski
At 03:31 AM 5/12/01 +0300, Zeev Suraski wrote: Yikes. We were only kidding, Jason :) Well, he could have the last argument of zend_hash_update() to receive the point to inserted value and done refcount++ on that and inserted again. ;-) I've been thinking we need to have add_* functions

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
: Friday, May 11, 2001 12:36 PM Subject: Re: [PHP-DEV] stat/fstat At 19:38 11/5/2001, Andrei Zmievski wrote: On Fri, 11 May 2001, Jason Greene wrote: True, I was lazy though and didn't feel like writing all that additional code, just to save 13 longs of memory space : ) 13

Re: [PHP-DEV] stat/fstat

2001-05-11 Thread Jason Greene
At 03:31 AM 5/12/01 +0300, Zeev Suraski wrote: Yikes. We were only kidding, Jason :) Well, he could have the last argument of zend_hash_update() to receive the point to inserted value and done refcount++ on that and inserted again. ;-) The only thing with that method is that I was trying

Re: [PHP-DEV] stat/fstat

2001-05-10 Thread Zeev Suraski
I just figured this only applies to stat() and not fstat(). Which also means they're totally incompatible with each other, although the documentation suggests they're essentially the same, other than the fact that one expects a file handle and the other expects a file name... What gives?

Re: [PHP-DEV] stat/fstat

2001-05-10 Thread Jason Greene
PM Subject: Re: [PHP-DEV] stat/fstat I just figured this only applies to stat() and not fstat(). Which also means they're totally incompatible with each other, although the documentation suggests they're essentially the same, other than the fact that one expects a file handle