Re: Re: Current working directory and multi-threaded environments

From: Date: Thu, 16 Mar 2000 17:21:33 +0000
Subject: Re: Re: Current working directory and multi-threaded environments
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-16895@lists.php.net to get a copy of this message
On Thu, 16 Mar 2000, Sascha Schumann wrote: > On Thu, Mar 16, 2000 at 06:57:22PM +0200, Andi Gutmans wrote: > > Guys, > > > > I just commited a file php_virtual_chdir.c to our CVS. It has a main() in > > it so you can compile it and run it. > > I want to base the new virtual current working directory on this code, > > which seems to work pretty well and normalizes the names of the > > directories. Look at the main and see that it deals very nicely with all > > sorts of scenarios. > > There are two main issues with this code: > > a) It doesn't *really* check if the directory exists. > > b) strtok() isn't thread-safe in all machine's. I think we have the > > necessary #define's to strtok_r for most platforms though. In any case, we > > can either use something small we write ourselves. > > Why not use strtok_r directly? I prefer to use the PHP #define's. I don't think Windows has an strtok_r. > > c) Doesn't expand ~ yet. > > d) No error handling yet. > > e) no virtual_expand_filepath() yet, which is exactly the same as > > the existing virtual_chdir. I think the real virtual_chdir() will probably > > wrap this function and maybe do some other checks which chdir() requires. > > f) does not handle COMMAND.COM special cases (i.e. "..."). This has been > a nasty security problem for many programs handling paths on Win16/32, > so we should try to cover this. Don't know this issue. Can you please expand on it? Does chdir() in Win16/32 do something special? Should we emulate that something special? > g) what about other O/S? Like what? This covers UNIX and Windows. Does PHP support other machines? Andi

« previous php.dev (#16895) next »