What is the path to my Web directory?
The wwwhome command returns the full path to your Web directory and can be used within CGI programs to refer to the location of your Web directory. The need to do so often arises when a CGI program must read or write to other files in your Web directory. Two examples follow, each demonstrating how the wwwhome command might be leveraged within a CGI program written in Perl. This first example uses wwwhome to determine the location of a data file: #!/usr/local/bin/perl chop($wwwhome = `wwwhome`); open(DATA,”$wwwhome/data.txt”); … The next example uses wwwhome to add a new directory to the location where Perl libraries are found: #!/usr/local/bin/perl BEGIN { chop($wwwhome = `wwwhome`); } use lib “$wwwhome/mypackage”; use MyPackage; … Note: You can hard code the location of your Web directory into a CGI program, but you run the risk of it breaking if your Web directory ever moves.
Related Questions
- What type of CAL will a non-active directory device using Outllok Web Access need when we are currently running Windows Server Device CALs and Exchange Server Device CALs?
- How can you expect to effectively coordinate thousands of volunteers to edit a web directory? Won it be a mess?
- What is the absolute file path to my web sites home directory?