RE: List files from a share of a windows client

2002-07-18 Thread Alessandro Forghieri

Greetings.

on my machine:

C:\ perl - e 42 -d
Default die handler restored.

Loading DB routines from perl5db.pl version 1.07
Editor support available.

Enter h or `h h' for help, or `perldoc perldebug' for more help.

main::(-e:1):   42
  DB1 opendir(DIR,'//webteam/') || warn($!)
No such file or directory at (eval 4)[D:/Perl/lib/perl5db.pl:1521] line 2.

  DB2 opendir(DIR,'//webteam/discoc/') || warn($!)

  DB3 x readdir(DIR)
0  'AUTOEXEC.BAT'
1  'baseclasses.log'
2  'bin'
3  'boot.ini'
[...]

//webteam is a machine name, //webteam/discoc a share name.
So it should work (except if you want the share list of a machine, which you
can get by using
capabilities from the Win32:: namespace - or even from parsing  `net view
machine`...)

Also if you are running apache as a service, be warned that the default
impersonating user (LocalSystem) does not typically have access permissions
to net share (this is especially true under NT Domain) - therefore you have
to change the impersonating user of the service.
(iven you have a working example this should not be your situation, however)

Cheers,
alf

P.S: I have a feeling this may be OT, on the mod_perl list...



List files from a share of a windows client

2002-07-17 Thread Heiss, Christian
Title: List files from a share of a windows client





Hello all,


How can I list the directives and files from a share which is on a windows client? I can only list the directories from the local machine, not from a remote one! If I catch a image with my code below, it works fine.

I start the browser with: http://servername/cgi-file?ordner=../logo=//sharename/pic.jpg
(To display the local directive/files and an image from a remote windows
machine)


If I start the browser with: http://servername/cgi-file?ordner=//sharename/logo=//sharename/pic.
jpg
(I thought this one works with the directory/files from the remote machine, but I get the error msg with: Can't open directory. Also if I change the slashes to backslashes or with the ip-address)


My actually code is:


...

 #!/usr/bin/perl -w

 use CGI;
 $query = new CGI;

 print $query-header();
 print $query-start_html();
 print table border=0 cellspacing=0;
 print trtd;

 #reading the directory
 opendir(DIR, $query-param(ordner)) || die Can't open directory!; 
 while($datei = readdir(DIR) ) { print $dateibr;
 }
 closedir(DIR);
 
 #This is only optional, to test if images can displayed (it works 
 fine) print '/td/trtrtd width=100img
src="<A" HREF="file:'.$query-" TARGET="_blank">file:'.$query-param(logo).' align=center/td';
 print /tr/table;

 print $query-end_html();

...


I need this configuration, cause to move our intraweb to a Linux Box with Apache. Later I'll have to generate hyperlinks to different files on the remote machines, therefore I have list first the content of the directory. Actually it runs on a Windows machine with perl and sambar and the files and data are on different machines. 

There it works fine. 
And I can't move the files to the Linux Box. Not yet, and not at all!!! 



Thanks for the help.


Regards,


Christian Heiss



_


LANconcept Moll GmbH 
Benzstrasse 1
88074 Meckenbeuren 

Voice: +49 (0) 7542 940 3 - 18 
Fax: +49 (0) 7542 218 24 
Mobil: +49 (0) 175 86 91 805
mailto:[EMAIL PROTECTED] 
visit our website http://www.datentechnik-moll.de 
_