Click to See Complete Forum and Search --> : opendir on Hostrocket


boredcrazy
03-28-2001, 01:32 AM
The path to my live folder on my virtual host is:
/home/napkin/public_html/

When I run this code, it returns a blank page when I know for a fact that I have an index.htm in that folder.

I've asked my web host about this but they've been of no help.

What am I doing wrong?


#!/usr/bin/perl

#I'm assuming this is
#where I am on the server.
$PathToLiveFolder = "/home/napkin/public_html/";

#Open the main folder and split
#the file names into an array
opendir (WWW, $PathToLiveFolder);
@filenames = readdir (WWW);
closedir (WWW);

#Print HTTP_Header and intro line
print "Content-type: text/html\n\n";
print "All the files and folders should be listed here.<br>";

#Print out the name of each file in the array
$x = 0;
while($x < @filenames)
{
print "-".$filenames[$x]."<br>";
$x++;
}

#Display file count
print "<br>There were this many files:".@filenames;

jemfinch
03-28-2001, 10:39 AM
Check my response to the other, more appropriately titled thread.

Jeremy