Re: Working directory of script is "/" !

2003-08-14 Thread Stas Bekman
Ed Grimm wrote: On Wed, 30 Jul 2003, Stas Bekman wrote: Perrin Harkins wrote: On Tue, 2003-07-29 at 07:23, Stas Bekman wrote: That's correct. This is because $r->chdir_file in compat doesn't do anything. The reason is that under threaded mpm, chdir() affects all threads. Of course we could ch

Re: Working directory of script is "/" !

2003-08-07 Thread Ed Grimm
On Wed, 30 Jul 2003, Stas Bekman wrote: > Perrin Harkins wrote: >> On Tue, 2003-07-29 at 07:23, Stas Bekman wrote: >> >>>That's correct. This is because $r->chdir_file in compat doesn't do >>>anything. The reason is that under threaded mpm, chdir() affects all >>>threads. Of course we could chec

Re: Working directory of script is "/" !

2003-07-30 Thread Stas Bekman
ColinB wrote: http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends I'm a little confused about the changes you've made here. You still mention using Apache::Registry, and then you added the text that describes ModPerl::RegistryPrefork but th

Re: Working directory of script is "/" !

2003-07-30 Thread ColinB
--- Stas Bekman <[EMAIL PROTECTED]> wrote: > > > This seems to work OK. Hopefully I should now be able to remove the > > mod_perl 1's Registry.pm file. > > > > Thanks everyone. > > Perfect. I've replaced the suggestion to use mp1's Apache::Registry > with this > better solution, which doesn't

Re: Working directory of script is "/" !

2003-07-30 Thread Stas Bekman
This seems to work OK. Hopefully I should now be able to remove the mod_perl 1's Registry.pm file. Thanks everyone. Perfect. I've replaced the suggestion to use mp1's Apache::Registry with this better solution, which doesn't require mp1: http://perl.apache.org/docs/2.0/user/porting/compat.html#C

Re: Working directory of script is "/" !

2003-07-30 Thread ColinB
> Don't mess with the cooker, try using a subclass, e.g.: > > # ModPerl/RegistryPrefork.pm > > package ModPerl::RegistryPrefork; > > use strict; > use warnings FATAL => 'all'; > > our $VERSION = '0.01'; > > use base qw(ModPerl::Registry); > > use File::Basename (); > > sub handler : method {

Re: Working directory of script is "/" !

2003-07-29 Thread Stas Bekman
PerlResponseHandler ModPerl::Registry and then re-started the server. But the printenv script just displays the working directory as "/". Try the following, instead of ModPerl::RegistryCooker::chdir_file above: sub chdir_file_normal { use File::Basename(); my $file = @_

Re: Working directory of script is "/" !

2003-07-29 Thread Stas Bekman
Perrin Harkins wrote: On Tue, 2003-07-29 at 07:23, Stas Bekman wrote: That's correct. This is because $r->chdir_file in compat doesn't do anything. The reason is that under threaded mpm, chdir() affects all threads. Of course we could check whether the mpm is prefork and do things the old way, bu

Re: Working directory of script is "/" !

2003-07-29 Thread Randy Kobes
my httpd.conf I replaced >PerlResponseHandler Apache::Registry > with >PerlResponseHandler ModPerl::Registry > and then re-started the server. > > But the printenv script just displays the working directory as "/". Try the following, instead of ModPerl::RegistryC

Re: Working directory of script is "/" !

2003-07-29 Thread Perrin Harkins
On Tue, 2003-07-29 at 07:23, Stas Bekman wrote: > That's correct. This is because $r->chdir_file in compat doesn't do anything. > The reason is that under threaded mpm, chdir() affects all threads. Of course > we could check whether the mpm is prefork and do things the old way, but that > means t

Re: Working directory of script is "/" !

2003-07-29 Thread ColinB
ndler ModPerl::Registry and then re-started the server. But the printenv script just displays the working directory as "/". Perhaps I've done this wrong? I did notice a couple of lines in the RegistryCooker.pm file that were already commented out, like this: #XXX:

Re: Working directory of script is "/" !

2003-07-29 Thread Stas Bekman
ColinB wrote: Thanks Stas that worked a treat, except that your call to File::Basename::basename should be File::Basename::dirname The strange reversion to "/" seems to have been cured too. you are right. Can you please post a working solution, so I'll add it to docs. BTW, perhaps we shoul

Re: Working directory of script is "/" !

2003-07-29 Thread ColinB
Thanks Stas that worked a treat, except that your call to File::Basename::basename should be File::Basename::dirname The strange reversion to "/" seems to have been cured too. Colin __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design s

Re: Working directory of script is "/" !

2003-07-29 Thread Stas Bekman
ir; } Thanks Stas. However, this seems to set the working directory to the server root, not the cgi-bin directory where the script resides. right, here is another try, again untested: Index: lib/Apache/compat.pm === RCS file: /home/c

Re: Working directory of script is "/" !

2003-07-29 Thread ColinB
... and even stranger, when I invoke the printenv cgi script for the FIRST time it STILL displays "/" for the working directory, but if I then click the IE browser's refresh (or CTRL-Refresh) button it changes to the server root /dir1/dir2/httpd. Subsequent clicks of the refresh but

Re: Working directory of script is "/" !

2003-07-29 Thread ColinB
; > chdir $dir; > } Thanks Stas. However, this seems to set the working directory to the server root, not the cgi-bin directory where the script resides. For example, my printenv script now displays: ... SCRIPT_FILENAME="/dir1/dir2/httpd/cgi-bin/printenv" SCRIPT_NAME="/

Re: Working directory of script is "/" !

2003-07-29 Thread Stas Bekman
ColinB wrote: I'm steadily making progress with getting a collection of mod_perl 1 compatibale scripts working with mod_perl 2 using the backward compatibility mode. However, I find that the working directory of all scripts is "/". This occurs for both ModPerl::Registry and Apache:

Working directory of script is "/" !

2003-07-29 Thread ColinB
I'm steadily making progress with getting a collection of mod_perl 1 compatibale scripts working with mod_perl 2 using the backward compatibility mode. However, I find that the working directory of all scripts is "/". This occurs for both ModPerl::Registry and Apache::Registry. T

Re: Working Directory

2002-07-16 Thread Stas Bekman
Josh Bernstein wrote: > Sounds great? Does he have anything that I could play with? I'm really > dying for that chdir(), my programmer says he depends on that > functionality. I'd even volunteer to do some benchmarks and what not > associated with the extra overhead of making the function threa

Re: Working Directory

2002-07-16 Thread Josh Bernstein
Sounds great? Does he have anything that I could play with? I'm really dying for that chdir(), my programmer says he depends on that functionality. I'd even volunteer to do some benchmarks and what not associated with the extra overhead of making the function thread safe. If its not really yet

Re: Working Directory

2002-07-16 Thread Stas Bekman
Elizabeth Mattijsen wrote: > At 06:10 PM 7/16/02 +, Stas Bekman wrote: > >>> Arthur told me he either had, or was going to fix this (on IRC). >> >> Yup, Arthur is working on an external package (ex::threads::safecwd?) >> which should solve this problem. Viva Arthur! I'll keep you updated >>

Re: Working Directory

2002-07-16 Thread Elizabeth Mattijsen
At 06:10 PM 7/16/02 +, Stas Bekman wrote: >>Arthur told me he either had, or was going to fix this (on IRC). >Yup, Arthur is working on an external package (ex::threads::safecwd?) >which should solve this problem. Viva Arthur! I'll keep you updated once >it gets released. Check out Arthur's

Re: Working Directory

2002-07-16 Thread Stas Bekman
Matt Sergeant wrote: > On Fri, 12 Jul 2002, Stas Bekman wrote: > > >>Josh Bernstein wrote: >> >>> After just upgrading to mod_perl2 with Apache2. My current @INC path >>>includes a "." on the end, which should reference the current working >

Re: Working Directory

2002-07-11 Thread Matt Sergeant
On Fri, 12 Jul 2002, Stas Bekman wrote: > Josh Bernstein wrote: > >After just upgrading to mod_perl2 with Apache2. My current @INC path > > includes a "." on the end, which should reference the current working > > directory, and therefore correctly locate

Re: Working Directory

2002-07-11 Thread Stas Bekman
Francesc X.Noria wrote: > On Thu, 11 Jul 2002 16:56:38 -0700 > Josh Bernstein <[EMAIL PROTECTED]> wrote: > > : "/". My question is how can I set the working directory to be the > : location of where the script is running. (This would make mod_perl > :

Re: Working Directory

2002-07-11 Thread Francesc X . Noria
On Thu, 11 Jul 2002 16:56:38 -0700 Josh Bernstein <[EMAIL PROTECTED]> wrote: : "/". My question is how can I set the working directory to be the : location of where the script is running. (This would make mod_perl : correctly locate file that I have included in the r

Re: Working Directory

2002-07-11 Thread Stas Bekman
Josh Bernstein wrote: >After just upgrading to mod_perl2 with Apache2. My current @INC path > includes a "." on the end, which should reference the current working > directory, and therefore correctly locate include locate in the script's > working directo

Working Directory

2002-07-11 Thread Josh Bernstein
After just upgrading to mod_perl2 with Apache2. My current @INC path includes a "." on the end, which should reference the current working directory, and therefore correctly locate include locate in the script's working directory. The problem is that the Working Dire