Re: popen() and virtual dir

From: Date: Sat, 10 Jun 2000 19:38:46 +0000
Subject: Re: popen() and virtual dir
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-20970@lists.php.net to get a copy of this message
Never had a need to do that, so I don't know, however I do beleive there is a simular functionality in the win32 process functions. My NT installation go messed up here last week, and I reinstalled, but haven't gotten vc reinstalled yet, so I cannot look up that info. Andi Gutmans wrote: > > Yeah but I don't think it behaves like popen() where you get the output > sent back. Don't you know if there is a way in DOS shell to run two > commands on the same line like in UNIX? > > Andi > > At 02:34 PM 6/10/00 -0400, Shane Caraveo wrote: > >Under windows, we probably have to switch to win32 functions, rather > >than c library functions. With the win32 functions, you can define a > >'working' directory which is where the program gets executed from. So > >if the program you want to execute is 'dir.exe', then you would prepend > >the virtual dir ('virtualdir\dir.exe') and also pass a 'parameter' > >(actually an item in a structure I think) that contains the working > >directory, which would simply be the virtualdir. > > > >Andi Gutmans wrote: > > > > > > At 11:08 AM 6/10/00 -0700, Rasmus Lerdorf wrote: > > > > > What do you guys want to do with popen() and virtual_dir? This > > effects all > > > > > of the exec() functions. > > > > > We can either do a real chdir() before calling it and mutexing the > > whole > > > > > section; or we can take a more complicated approach of creating a new > > > > > process and doing the chdir() there. Last but not least, we could just > > > > > disable these functions :) > > > > > > > >Well, disabling them is not really an option. As for creating a new > > > >process and doing a chdir() there. These functions already create a new > > > >process. Would something like: > > > > > > > > popen("cd /path; cmd") > > > > > > > >do the trick? ie. prepend the virtual_dir chdir to the cmd string we pass > > > >to these functions. The chdir should be isolated to the spawned process. > > > > > > That sounds like a good idea! It might actually work. The question is, how > > > do you do it on Windows? And do all major UNIX shells support the command1; > > > command2 syntax? bash, tcsh and sh do, but I don't know about shells such > > > as ksh and so on. Is this maybe in a standard? > > > > > > Andi > > > --- > > > Andi Gutmans <andi@zend.com> > > > http://www.zend.com/ > > > > > > -- > > > PHP Development Mailing List > > > <http://www.php.net/> > > > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-dev-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > --- > Andi Gutmans <andi@zend.com> > http://www.zend.com/ > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#20970) next »