Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 trouble with os.listdir on a network drive
(Jun-04-2019, 03:19 PM)lconner Wrote: I not sure why using the IP address did not have the same result.

Because they are different.
Opening a file requires a file system (in an abstract view).
The ip is just a network address. Nothing more.

The magic of net mount is, that it mounts a network-filesystem as local fake file system.

I guess there are also libraries to use the Samba Protocol
directly from Python without the use of net.

(Jun-04-2019, 03:19 PM)lconner Wrote: In another script I have paths with the IP address and files are retrieved with out issue.

Hmm, interesting. Can you show this script?

(Jun-04-2019, 03:19 PM)lconner Wrote: I assume, net, is the python method for establishing a connection to a drive (i.e. mount it).
No, it's the windows way to mount a windows share. On Linux you can mount supported network file systems with mount.
The same effect on Linux. It appears as a real file system. The user/program doesn't know that
it's accessing a fake file system, where all calls are translated.

I don't know if there is support for samba protocol in the python standard library. I am not a windows user.
I think not.

(Jun-04-2019, 03:19 PM)lconner Wrote: also, both of you mentioned samba and paramiko which are for Linux if i am not mistaken. Was there something in my post that made you think i was using Linux?

Samba is the name of the protocol for Windows Shares. I don't know who invented this name.
Paramiko is used to establish a ssh (secure shell) session to the Linux server.
It's a command line interface, but paramiko supports more than that. I have used this library one time
for a simple thing, but it supports more. It has channels and other security stuff.

In general there are different methods to share files across networks:
  • TFTP (simpler than ftp, used for routers and network boot)
  • FTP (native support in python, os independent)
  • SFTP (SSH + FTP, no native support)
  • scp (copy files over ssh)
  • Samba (Windows Shares, no native support) / often mounted previously by user scripts
  • NFS (Unix Shares, transparently as file system mounted)
  • IPFS (InterPlanetary File System) used for bitchute

But the most often possible solutions you find in companies, is samba (Windows Shares).
In private area it depends on the nerd level :-D
My code examples are always for Python >=3.6.0
Almost dead, but too lazy to die:
All humans together. We don't need politicians!

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Nested Subdirectory within current sub on shared network drive Agregware 1 369 Jun-19-2019, 10:07 PM
Last Post: Gribouillis
  download file from google drive .. evilcode1 7 3,235 Sep-21-2018, 06:13 PM
Last Post: evilcode1
  os.listdir(path) and non-string as input metalray 4 4,013 Aug-15-2018, 11:43 AM
Last Post: metalray
  listdir trouble Dixon 1 750 Jan-17-2018, 11:32 PM
Last Post: micseydel
  Best Module for Navigating Google Drive? HiImNew 2 930 Nov-29-2017, 01:38 AM
Last Post: HiImNew
  Uploading CSV Files to Google drive in a specified folder prashant8530 1 1,294 Sep-30-2017, 10:58 AM
Last Post: Larz60+

Forum Jump:

Users browsing this thread: 1 Guest(s)