Sorry,
got it working with your advice:
opendir(DIR, "G:/FTP/Ski") or die print "Error $!"; worked in the end...
Damn these slashes :-D
Thanks for the help
--
View this message in context:
http://old.nabble.com/How-to-get-a-file-listing-tp27644565p27668922.html
Sent from the mod_perl - Genera
No,
that doesn't work either. I used opendir (DIR, "G:\FTP\Ski") ...
I've tried the slashes in all directions, and with and without preceding and
slashes in the end.
e.g. \Ski, \Ski\, /ski, /ski/
How do I get perl to understand the context? is there some function that
points to the root? (even
Apache knows the context, PERL does not.
Fully qualify that directory name and it should work.
On 2/20/2010 1:01 PM, ceauke wrote:
Hi there
Here is my code. I get the IMG displayed but also the perl error: No such
file or directory.
"
#!E:\ea12\apps\tech_st\10.1.2\perl\5.6.1\bin\MSWin32-x
Hi there
Here is my code. I get the IMG displayed but also the perl error: No such
file or directory.
"
#!E:\ea12\apps\tech_st\10.1.2\perl\5.6.1\bin\MSWin32-x86\perl.exe
print "Content-type: text/html \n\n";
print "Test:";
print " /Ski/temp.jpg ";
opendir(DIR, "/Ski") or die print "Error $!";
Hi i asume you using xamp and test.gif is a simple git picture?
The apache webserver will try to execute
myserver.com/cgi-bin/mydir/test.gif
put the picture anywhere else (eg C:\xampp\htdocs\mydir\).
Maybe there are some more infos in your log file (eg.
C:\xampp\apache\logs\error.log)
You ca
Hi guys
Running apache on winxp.
The bizarre thing is in my browser I can put:
myserver.com/mydir2/test.gif and that works
myserver.com/cgi-bin/mydir/test.gif gives internal server error. but I know
the opendir command can at least read mydir. Still, how should I 'enable'
mydir2?
another issue
Depending on your server setup, you may or may not be able to read
\mydir2\. Whether on windows or a unix variant, apache is configured to
run as "some user" (often, "nobody" on unix); and that user needs to be
given at least read access to the \mydir2\ directory in order for this
to work.
A
On Thu, Feb 18, 2010 at 13:20, ceauke wrote:
> So my structure is like this:
> \cgi-bin\myprog.cgi < my program
> \cgi-bin\mydir1\ <- this one can be seen by my program
> \mydir2\ <- how do I show this content?
opendir my $DH, '\mydir2\' or die "Unable to open mydir2: $!";
The
Wow, thanks. It's working. I have a problem with the dir structure:
Perls seems to search for mydir in \cgi-bin\ and not where I defined mydir
in the apache conf file.
So my structure is like this:
\cgi-bin\myprog.cgi < my program
\cgi-bin\mydir1\ <- this one can be seen by my program
opendir(DIR, "/your/dir");
my @gifs = grep { /\.gif$/ } readdir(DIR);
ceauke wrote:
Hi guys
I wanted to do a simple script to show all pictures in a specific folder.
But I don't see any functions to read all files in a folder.
The logic needs to go something like this:
- Open directory to read
Sorry, I completely forgot to say.
This is for MOD_PERL on apache. So I want the webserver to show an unknown
amount of pictures.
--
View this message in context:
http://old.nabble.com/How-to-get-a-file-listing-tp27644565p27644823.html
Sent from the mod_perl - General mailing list archive at N
#!/usr/local/bin/perl
chdir("/path/to/my/directory");
while($filename=<*.gif>)
{
print "$filename\n";
}
# Enjoy!
ceauke wrote:
Hi guys
I wanted to do a simple script to show all pictures in a specific folder.
But I don't see any functions to read all files in a folder.
The logic needs t
12 matches
Mail list logo