Re: [PHP-DEV] Re: Current working directory and multi-threaded environments From: Sascha Schumann (sascha <email protected>)
Date: 03/16/00

On Thu, Mar 16, 2000 at 08:27:41AM -0500, rubys <email protected> wrote:
>
>
> >> You are free to disagree with me, and I may have missed something or I
> >> could very much be wrong. It just seems to me that unless more is done
> >> than what you propose, examples such as the following will change
> behavior:
> >>
> >> http://www.php.net/manual/html/function.readdir.html
> >>
> >> And that's an easy one. dl, ftp_get and others can be passed relative
> >> paths. Fortunately, this list is finite. What would concern me most is
> >> the extensions that interface to external code.
> >
> >Why does it change behaviour?
> >
> >The functions (not readdir, but opendir) will create an absolute path
> >from the relative path passed to them.
>
> I must be missing something very obvious. Excerpts from
> ext/standard/dir.c:
>
> PHP_FUNCTION(opendir):
> _do_opendir(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
>
> static void _php_do_opendir:
> dirp->dir = opendir((*arg)->value.str.val);
>
> >From what I can see, a relative path coded in the web page passes directly
> through to a system call. That system call will be entirely unaware of
> PHP's notion of a virtual (per request and/or thread) current directory,
> and will proceed to use the "real" (per process) current directory.

We are speaking about _future_ changes to the current source base,
not about how it works today.

- Sascha

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>