Python Forum
trouble with os.listdir on a network drive
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
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question How to get a removable disc type in drive Daring_T 12 967 Feb-11-2024, 08:55 AM
Last Post: Gribouillis
  open python files in other drive akbarza 1 632 Aug-24-2023, 01:23 PM
Last Post: deanhystad
  Integrating Google Drive in App Lahearle 0 439 Jul-19-2023, 05:51 PM
Last Post: Lahearle
  code to send attachments contained on the drive. stefanoste78 1 822 Oct-12-2022, 02:16 AM
Last Post: Larz60+
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,729 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Cant Access D: Drive kucingkembar 4 1,262 Jul-28-2022, 04:53 PM
Last Post: kucingkembar
  Calling exe on network drive GrahamL 4 2,466 Jan-21-2022, 12:01 PM
Last Post: GrahamL
  Failing to copy file from a network to a local drive tester_V 4 6,972 Jan-20-2021, 07:40 AM
Last Post: tester_V
  listdir on IP Adress OEMS1 3 2,832 Jul-19-2020, 06:01 PM
Last Post: bowlofred
  Nested Subdirectory within current sub on shared network drive Agregware 1 1,883 Jun-19-2019, 10:07 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020