By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,525 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

Path problem

rajiv07
100+
P: 141
Hi to all,

I am running a perl script under Windows 2003 IIS 6.0 server.In my script i try to read a html file.For that i have use the relative path

my $file="../templates/myfile.html";

But it says the file is not exist,which is existing.But when i use absolute path
(my $file="C:/Inetpub//cgi-bin/elearning/templates/myfile.html";) its working fine.

my wondering is that how do i do that path setting.

Thanks
Rajiv
Jun 23 '08 #1
Share this Question
Share on Google+
3 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
I am not sure I follow what you are asking. Can you elaborate? Also, what directory are you launching the html file from?

Regards,

Jeff
Jun 23 '08 #2

rajiv07
100+
P: 141
I got the solution.The problem is the working directory is c:/inutpub/cgi-bin/ but the perl scripts are in c:/inutpub/cgi-bin/elearning/query/ so if i call '../templates/myfile.html' it check in c:/inutpub/templates/myfile.html which is not there.so it simply gives error.
we can findout the working directory using getpwd() function


Regards
Rajiv
Jun 24 '08 #3

numberwhun
Expert Mod 2.5K+
P: 3,503
I got the solution.The problem is the working directory is c:/inutpub/cgi-bin/ but the perl scripts are in c:/inutpub/cgi-bin/elearning/query/ so if i call '../templates/myfile.html' it check in c:/inutpub/templates/myfile.html which is not there.so it simply gives error.
we can findout the working directory using getpwd() function


Regards
Rajiv
Glad you worked it out.

Regards,

Jeff
Jun 24 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.