At 04:51 PM 1/24/2003 -0800, Rasmus Lerdorf wrote:
Which broken systems?  Certainly not on FreeBSD or Linux.  A little test:

      stat("/home/rasmus/foo/u2.inc",&sb);

That ends up doing just a single stat on FreeBSD:

stat("/home/rasmus/foo/u2.inc",0x9fbffa0c)       = 0 (0x0)

and on Linux:

stat64("/home/rasmus/foo/u2.inc", {st_mode=S_IFREG|0644, st_size=12, ...}) = 0
Yes you are right. But I still think the advantages of having a canonical file path is good. It improves error messages, it allows for open_basedir and include_once() to work 100%. I don't think it's worth killing good stable functionality for this.

What needs to be taken from your timings is not the relative time of stat() vs. realpath() but the absolute times. You can see that on Linux the speed of realpath() is 12 microsecond. I don't believe you can feel this in a script even if you have tens of realpath()'s per script (at least vs. stat()). Now on FreeBSD it takes about half a millisecond. That is much more but I'm not sure it's still worth breaking functionality for this.

That said, we could possibly have a fast mode and use fstat() to get some device information on the open file. I am worried about functionality though. I'm not sure it's worth breaking.

Andi


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to