Re: Re: Current working directory and multi-threaded environments
| From: | rubys at us dot ibm dot com | Date: | Wed, 15 Mar 2000 19:21:51 +0000 |
| Subject: | Re: Re: Current working directory and multi-threaded environments | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16852@lists.php.net to get a copy of this message | ||
>> I'm not sure if I need to do the real getcwd() per-request or if doing
it
>> on PHP startup once is good enough.
>
>Why should a threaded web server change its per-process
>work directory?
I'm confused. getwd doesn't change the working directory, right?
In any case, I agree with Sascha...if it is at all possible, please don't
change the working directory. Here's an excerpt from sapi/servlet which is
my attempt to limit the scope of the problem this causes for Java until a
real solution is available:
getcwd(cwd,MAXPATHLEN);
file_handle.handle.fp = php_fopen_primary_script();
chdir(cwd);
- Sam Ruby