File reading across network (windows)

  • Thread starter Prof. William Battersea
  • Start date
P

Prof. William Battersea

Hello,

Suppose I have a Vista machine called VISTA and an XP machine called
XP in a workgroup named WORKGROUP. Physically they're connected to a
router and I can see lists of public and shared files on each of them.
How do I address these for IO?

A search suggested that the form open(r"\\server\folder\folder"), but
I tried many combinations guessing what it wants for that path in my
case (r"\\WORKGROUP\VISTA", "\\VISTA\PUBLIC", etc), and none have
worked so far.

Thanks!
 
D

Diez B. Roggisch

Prof. William Battersea said:
Hello,

Suppose I have a Vista machine called VISTA and an XP machine called
XP in a workgroup named WORKGROUP. Physically they're connected to a
router and I can see lists of public and shared files on each of them.
How do I address these for IO?

A search suggested that the form open(r"\\server\folder\folder"), but
I tried many combinations guessing what it wants for that path in my
case (r"\\WORKGROUP\VISTA", "\\VISTA\PUBLIC", etc), and none have
worked so far.

You need to create network shares in windows first. Once these are
established, *all* programs using file-IO - including python - can
access files.

Diez
 
B

binaryjesus

Hello,

Suppose I have a Vista machine called VISTA and an XP machine called
XP in a workgroup named WORKGROUP. Physically they're connected to a
router and I can see lists of public and shared files on each of them.
How do I address these for IO?

A search suggested that the form open(r"\\server\folder\folder"), but
I tried many combinations guessing what it wants for that path in my
case (r"\\WORKGROUP\VISTA", "\\VISTA\PUBLIC", etc), and none have
worked so far.

Thanks!

Does the remote folder require authentication? Maybe you could map a
network drive and then access files using (z:/VISTA-FOLDER/ )
 
D

Diez B. Roggisch

You need to create network shares in windows first. Once these are
It isn't absolutely essential to create a network share first: most
windows apis, including those used by Python, will be very happy with a
UNC path:

<snip/>

You still need to create a share on the serving machine. The UNC-path is
just for accessing it without *mounting* it on a local machine under some
drive-letter. I should have worded clearer what I meant, though.

You are of course right that actually mounting the drives makes it much
easier to deal with them regarding authentication.

Diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top