Re: How to get a file listing

2010-02-20 Thread ceauke
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

Re: How to get a file listing

2010-02-20 Thread ceauke
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

Re: How to get a file listing

2010-02-20 Thread Brad Van Sickle
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

Re: How to get a file listing

2010-02-20 Thread ceauke
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 $!";

Re: How to get a file listing

2010-02-19 Thread Keywan Ghadami
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

Re: How to get a file listing

2010-02-18 Thread ceauke
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

Re: How to get a file listing

2010-02-18 Thread Michael A. Capone
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

Re: How to get a file listing

2010-02-18 Thread Alan Young
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

Re: How to get a file listing

2010-02-18 Thread ceauke
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

Re: How to get a file listing

2010-02-18 Thread Dzuy Nguyen
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

Re: How to get a file listing

2010-02-18 Thread ceauke
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

Re: How to get a file listing

2010-02-18 Thread Michael A. Capone
#!/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