Jan-06-2022, 12:45 PM
files = glob.glob(r"\\192.168.1.4\aaaa\*.xml")This could not work. It's a share over network and not mounted as a real file system.
You can mount the share on Linux and work with Python on the mountpoint.
You can mount the share on Windows and work with the mounted drive.
You can also use a nice wrapper for file systems:
# python3 -m pip install fs fs.smbfs # read the docs: https://docs.pyfilesystem.org/en/latest/index.html import fs with fs.open_fs("smb://USERNAME:[email protected]") as samba_share: # samba_share is: # BoundGlobber(pattern, path="/", namespaces=None, case_sensitive=True, exclude_dirs=None) # https://docs.pyfilesystem.org/en/latest/globbing.html#matching-files-and-directories samba_share.glob("**/*.xml", "/aaaa").remove()
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!