Hi, Personally, I use absolute paths. I usually have a variable set to a base directory for easier maintainance.
If your curious about what the current working directory actually is you can try this in a script: print "Working directory is " . `cmd /c cd`; Notice the backticks. The user account running Apache, "Local System" by default, needs the sufficient file permissions. Hope this helps, ------------------------------------------------------------------------ ! Robert Friberg 0733-839080 ! Developer/Trainer perl,java,dotnet,linux,xml,uml,sql,c/c++,vb ! Ensofus AB http://www.ensofus.se/ ! Miljö Online AB http://www.miljo-online.se/ ------------------------------------------------------------------------ > -----Original Message----- > From: Ted Byers [mailto:[EMAIL PROTECTED] > Sent: Wednesday, January 07, 2004 9:23 PM > To: [EMAIL PROTECTED] > Subject: Website organization for secure ASP, perl scriptig > > > OK, It looks like I have Apache setup and working correctly, > including Perl, > using mod-perl, and ASP. Now, I want to setup my website so that the > scripts and the data they work on (that isn't taken from either a > form or a > database) live in directories outside htdocs (just as cgi-bin). > But I have > encountered a bit of trouble in that, when I use a script that > does not need > to read data from a file, it works perfectly, but I have yet to > get a script > that reads from a file to work. Note, it isn't getting the perl > for reading > a file that is the problem, since the script works fine from the command > line. The problem is either where the script thinks it is running (which > may not be where I would intuitively think it is, given all other > programs I > have written have been in compiled languages like C++ or FORTRAN) > or it is a > problem with permissions. Lets suppose that I have a hyperlink > on my index > page in htdocs which refers to a perl script in cgi-bin, and this script > needs to read a file called mydata.dat (plain ascii, tab > delimited, columns > of numbers). Will the script think it is running in cgi-bin, and look for > the data file there, or will it think it is in htdocs and look for the > datafile there? And, if it will want to look in htdocs but I want it to > look in cgi-bin, or some other directory outside htdocs (say, > cgi-basic-data), how do I a) get it to look in the right place > using a path > relative to htdocs (e.g. "../cgi-basic-data" using a relative path I was > able to get to work using VBScript), and do I have to do anything > special to > make sure it has the appropriate permissions to read the file? > > I should say this is with the latest binary distribution of > Apache with SSL, > mod-perl, ASP, PHP &c. for Windows (and I'm runnign W2K), but I'd expect > that this particular question doesn't depend significantly on the > OS or the > distribution used. > > Thanks > > Cheers > > Ted > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]