Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Files In Another Directory

Status
Not open for further replies.

iaresean

Programmer
Mar 24, 2003
570
ZA
Help!

I have written a perl cgi script, but in order for the script to work it needs to be able to access files in the /root directory and other various directory's on my server. I do have root permissions on the server. But I do not know how to tell the program to fetch the specific file. It keeps on searching for the file from the cgi-bin directory. So say for example i needed to access /var/info.txt it will search for .../cgi-bin/var/info.txt and not /var/info.txt

Thanks for all your time and effort you put into helping me, a very inexperienced beginner.
 
the ~ (tilde) gets back to the root in UNIX

cd ~

or to a folder from the root

cd ~/cgi-bin/var/

cheers
Duncan
 
Is the webserver chrooting CGI?

________________________________________
Andrew - Perl Monkey
 
Thanks for all your input. The answer was all in sudo. I had to use sudo in order to give my web page root permissions so that it was able to view any directory and access any file. This is a bit dangerous on the security side of things though. So I will have to tread with care.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top