Path problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajiv07
    New Member
    • Jun 2007
    • 141

    Path problem

    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
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    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

    Comment

    • rajiv07
      New Member
      • Jun 2007
      • 141

      #3
      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

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by rajiv07
        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

        Comment

        Working...