Reputation: 23
Background:
I'm running the ABSApp for sentiment analysis which requires Linux or Mac to run on. Our network filesystems require permission to access our datasets, and I'm trying to figure out how to give that permission via my code so that I can run my preprocessing scripts on our data and store it to the network since I'm not allowed to store it locally. I can access the files via my Linux dual bootup by connecting to the server directly, but this permission doesn't carry across the system when I run my code.
Tried:
I've tried to access the dir with os.walk(dir, topdown=True), and when I step through the debugger I see this message:
top = fspath(top)
dirs = []
nondirs = []
walk_dirs = []
# We may not have read permission for top, in which case we can't
# get a list of the files the directory contains. os.walk
# always suppressed the exception then, rather than blow up for a
# minor reason when (say) a thousand readable directories are still
# left to visit. That logic is copied here.
I don't see anything useful when I jump to the definition for fspath(path) either.
I read the documentation for os.access(), but I already know I don't have permission to the files. It does say this at the bottom, but it doesn't tell me a work-around:
Note
I/O operations may fail even when access() indicates that they would succeed,
particularly for operations on network filesystems
which may have permissions semantics beyond the usual POSIX permission-bit model.
TLDR:
So does anyone have any solutions for accessing and writing to a dir on a local network server that requires permissions? I can do python, java and c++, so I'm open to any solutions that exist! Thanks in advance!!
Upvotes: 0
Views: 1518
Reputation: 23
Solved: Needed to add noperm at the end to mount with write permissions
sudo mount.cifs <domain> /home/<mount location> -o username=<username>,vers=<set accordingly>,noperm
Upvotes: 1