|
I have managed to get a print out of the directory by 'globbing' it. The code I used for it is:
#!D:\Perl\bin\Perl.exe wT
use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
my @files_found;
@files_found = <D:\\domains\\weemedesigns.co.uk\\logs\\*>;
print "Content-type: text/html \n\n";
print "@files_found";
open (LOGFILE, ">D:\\domains\\weemedesigns.co.uk\\wwwroot\\cg i-bin\\file.txt") || die ('open', 'file');
if(-e LOGFILE)
{
print "File exists.";
}
if(-w LOGFILE)
{
print "File writable.";
}
if(-x LOGFILE)
{
print "File executable.";
}
if(-o LOGFILE)
{
print "File owned by user.";
}
if(-z LOGFILE)
{
print "File exists and has zero.";
}
if(-f LOGFILE)
{
print "Entry is a plain file.";
}
if(-d LOGFILE)
{
print "Entry is a directory.";
}
if(-T LOGFILE)
{
print "File is TEXT.";
}
if(-B LOGFILE)
{
print "File is BINARY.";
}
I got the following output:
D:\domains\weemedesigns.co.uk\logs\file.txt D:\domains\weemedesigns.co.uk\logs\W3SVC2902
Software error:
openfile at d:\domains\weemedesigns.co.uk\wwwroot\cgi-bin\add_to_basket.pl line 19.
For help, please send mail to this site's webmaster, giving this error message and the time and date of the error.
It seems to be having a problem with opening the file. Any suggestions why this is? What version of perl is installed? I know that versions earlier than 5.6 have problems with the 'warning' system i.e. -w in the shebang line - I have posted about this problem previously.
|