Problem with Cwd module in IIS 
Author Message
 Problem with Cwd module in IIS

When I use the cwd() function of the Cwd module in a CGI script I it returns
the path of the parent directory of the directory where the script is
located instead of the actual directory where the script is located. I
tested the same script by running it in the DOS shell instead of the browser
and it returned the correct path.

Why is it not returning the correct path when I run it as a CGI??

(I'm running Win NT4, IIS)



Mon, 09 Apr 2001 03:00:00 GMT  
 Problem with Cwd module in IIS

Quote:

> When I use the cwd() function of the Cwd module in a CGI script I it
> returns the path of the parent directory of the directory where the
> script is located instead of the actual directory where the script is
> located.

Could that be working as documented? That is, could what you're getting
actually be the current working directory? Remember, the CGI spec doesn't
say that your program will be started with any particular working
directory; it could be a different directory every day of the week!
Cheers!

--
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



Tue, 10 Apr 2001 03:00:00 GMT  
 Problem with Cwd module in IIS
[Posted and Emailed]  In article


Quote:


>> When I use the cwd() function of the Cwd module in a CGI script I it
>> returns the path of the parent directory of the directory where the
>> script is located instead of the actual directory where the script is
>> located.

>Could that be working as documented? That is, could what you're getting
>actually be the current working directory? Remember, the CGI spec doesn't
>say that your program will be started with any particular working
>directory; it could be a different directory every day of the week!
>Cheers!

In fact, in IIS the working directory will always be the nearest higher level
directory in the script alias list.  (e.g if /cgi-bin/ is the script alias
and a script is executed from /cgi-bin/subdir/ and there is no alias for
/cgi-bin/subdir/ then the current working directory will be /cgi-bin/)

--
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================

http://home1.gte.net/ehp/   | http://www.interact2day.com/



Tue, 10 Apr 2001 03:00:00 GMT  
 Problem with Cwd module in IIS


Quote:
>When I use the cwd() function of the Cwd module in a CGI script I it returns
>the path of the parent directory of the directory where the script is
>located instead of the actual directory where the script is located. I
>tested the same script by running it in the DOS shell instead of the browser
>and it returned the correct path.

>Why is it not returning the correct path when I run it as a CGI??

>(I'm running Win NT4, IIS)

It is returning the correct path.

Have a look at all the posts in this newsgroup over the last few weeks that
mention that the CGI spec does not say that the current directory will be
set to that of the script. Could be c:\ today, and h:\temp tomorrow...

--
Sam

Remember that the P in Perl stands for Practical.  The P in python
doesn't seem to stand for anything.



Tue, 10 Apr 2001 03:00:00 GMT  
 Problem with Cwd module in IIS
Ok, so the actual working directory in CGI may be different to the one where
script is located. So, what's the best way to determine the actual directory
where the script is located? (Win NT, IIS)


Tue, 10 Apr 2001 03:00:00 GMT  
 Problem with Cwd module in IIS
[Posted to comp.lang.perl.modules and a copy mailed.]



Quote:
> Ok, so the actual working directory in CGI may be different to the one where
> script is located. So, what's the best way to determine the actual directory
> where the script is located? (Win NT, IIS)

The special variable $0 contains the absolute path to the program,
written (unfortunately) with MS-DOSish backslashes.

--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/



Tue, 10 Apr 2001 03:00:00 GMT  
 Problem with Cwd module in IIS
: Ok, so the actual working directory in CGI may be different to the one where
: script is located. So, what's the best way to determine the actual directory
: where the script is located? (Win NT, IIS)

perldoc FindBin

cu,
  Martin
--
                        | Martin Vorlaender | VMS & WNT programmer

 Microsoft wants        |       http://www.pdv-systeme.de/users/martinv/



Thu, 12 Apr 2001 02:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. cwd, iis, ActiveState Perl 613

2. Finding logical cwd vs physical cwd

3. Cwd module

4. beginner: how to use cwd() module?

5. Problem with Cwd.pm (OS/2)

6. Problem with Net::FTP CWD method

7. install/Cwd problem with AFS

8. Perl for Win95 problem: Subroutine cwd redefined

9. Problems with Cwd.pm for Perl 5.001m on AIX

10. NT,IIS: works from cmdline, but not from IIS (CGI)

11. GD module with IIS (v3) & NT

12. Module which enables you to program Internet Service Manager (IIS)

 

 
Powered by phpBB® Forum Software