Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 trouble with os.listdir on a network drive
#11
(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: https://sourceserver.info
All humans together. We don't need politicians!
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Trouble processing file villumanati 1 65 Jul-30-2019, 04:17 AM
Last Post: Larz60+
  Trouble importing modules on a new python version snackman_barry 2 139 Jul-12-2019, 11:15 AM
Last Post: snackman_barry
  More Python Embedding Trouble jibarra 3 160 Jul-11-2019, 09:25 PM
Last Post: Gribouillis
  Raspberry - Python 3.7 - Installation trouble madjo1983 2 180 Jul-07-2019, 02:06 AM
Last Post: DeaD_EyE
  Nested Subdirectory within current sub on shared network drive Agregware 1 240 Jun-19-2019, 10:07 PM
Last Post: Gribouillis
  Trouble Understanding Why This Code Works crocolicious 2 266 Apr-09-2019, 05:24 PM
Last Post: crocolicious
  Trouble writing over serial EngineerNeil 1 273 Apr-07-2019, 08:17 PM
Last Post: j.crater
  Trouble converting JSON String to Dictionary RBeck22 7 664 Mar-28-2019, 12:12 PM
Last Post: RBeck22
  Trouble coding hangman Tay 1 251 Mar-28-2019, 01:57 AM
Last Post: ichabod801
  Trouble on importing function from astropy library samsonite 4 350 Mar-21-2019, 12:18 PM
Last Post: samsonite

Forum Jump:


Users browsing this thread: 1 Guest(s)