Ido Perelmutter
05-22-2003, 03:10 PM
Well I'm back here again. This time, I want to print the files in a certain directory on the server where my program is installed.
I use the variable $cur to hold the absolute path to the directory, and the following code to print files:
opendir (DIR, $cur);
@files = readdir DIR;
closedir DIR;
for $i (@files) {
# Do Something With the files #
}
Well, it doesn't work. If I open "." or ".." instead of $cur it works, so I've tried to change the current working directory to $cur with chdir($cur), but it doesn't work too.
What might be the problem?
thanks.
I use the variable $cur to hold the absolute path to the directory, and the following code to print files:
opendir (DIR, $cur);
@files = readdir DIR;
closedir DIR;
for $i (@files) {
# Do Something With the files #
}
Well, it doesn't work. If I open "." or ".." instead of $cur it works, so I've tried to change the current working directory to $cur with chdir($cur), but it doesn't work too.
What might be the problem?
thanks.