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.


Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

Replies are listed 'Best First'.
Re: Re: Manipulating files on Windows shares
by EyeOpener (Scribe) on May 09, 2003 at 23:20 UTC
    Thanks BrowserUk! Apparently I had a slash/backslash problem -- the angle operator only likes foward slashes, but your example works, and I was able to fix my code. The file test operators work on the shares as well, which is terrific! Sorry it took so long to follow up on this.

    -E