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

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 check whether the

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 { my $class

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:

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 require mp1:

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

Working directory of script is / !

2003-07-29 Thread ColinB
scripts to fail because they call open() using a relative pathname. Surely the working directory of a script should be the directory in which it resides? It does not seem to matter what directory I am in when I invoke httpd; the script's current directory is always /. I am mystified. Here

Re: Working directory of script is / !

2003-07-29 Thread Stas Bekman
. This causes many scripts to fail because they call open() using a relative pathname. Surely the working directory of a script should be the directory in which it resides? It does not seem to matter what directory I am in when I invoke httpd; the script's current directory is always /. That's correct

Re: Working directory of script is / !

2003-07-29 Thread ColinB
--- Stas Bekman [EMAIL PROTECTED] wrote: ... I won't commit it yet, but you can override it in your startup.pl, until the dust settles down: require Apache::compat; sub Apache::RequestRec::chdir_file { my $dir = @_ == 2 ? $_[1] : $_[0]-filename; chdir $dir; } Thanks Stas.

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 button continue to

Re: Working directory of script is / !

2003-07-29 Thread Stas Bekman
ColinB wrote: --- Stas Bekman [EMAIL PROTECTED] wrote: ... I won't commit it yet, but you can override it in your startup.pl, until the dust settles down: require Apache::compat; sub Apache::RequestRec::chdir_file { my $dir = @_ == 2 ? $_[1] : $_[0]-filename; chdir $dir; } Thanks

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

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 should

Re: Working directory of script is / !

2003-07-29 Thread ColinB
Can you please post a working solution, so I'll add it to docs. I added this to my startup.pl just after the use Apache::compat(); sub Apache::RequestRec::chdir_file { use File::Basename(); my $file = @_ == 2 ? $_[1] : $_[0]-filename; my $dir = File::Basename::dirname($file);

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 that

Re: Working directory of script is / !

2003-07-29 Thread Randy Kobes
On Tue, 29 Jul 2003, ColinB wrote: Well I commented out the following line in perl/lib/site_perl/5.8.0/sun4-solaris/Apache2/ModPerl/RegistryCooker.pm like this: #*chdir_file = \NOP; and added an identical definition to the above in my startup.pl file like this: sub

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,

Re: Working directory of script is / !

2003-07-29 Thread Stas Bekman
Randy Kobes wrote: On Tue, 29 Jul 2003, ColinB wrote: Well I commented out the following line in perl/lib/site_perl/5.8.0/sun4-solaris/Apache2/ModPerl/RegistryCooker.pm like this: #*chdir_file = \NOP; and added an identical definition to the above in my startup.pl file like this: sub