in reply to Manipulating files on Windows shares
Try print $_, $/ for <//hostname/sharname/*>
Or print $_, $/ for <//${ENV{COMPUTERNAME}}/perl/*>; to access a local share without hardcoding the local hostname. This work under NT, but I'm not sure about other flavours 95/98 etc.
or
open DH, '\\hostname\sharename\' or die $!; # NB: single quotes # or open DH, "\\\\hostname\\sharename\\" ... if you use double quotes print $_, $/ for readdir DH;
You could also net use x: \\server\share from the command line or the "Map network drive" from the explorer or Win32::NetResource* to map a local drive specifier to the remote share and then use the standard
print $_, $/ for <x:/*>; syntax to access it.
* That said, I don't understand the pod for this module enough to offer a code sample for doing this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Manipulating files on Windows shares
by EyeOpener (Scribe) on May 09, 2003 at 23:20 UTC |