-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to read files using that are being used by some other users' proccesses on remote server (High-level API) #282
Comments
I think that the default behaviour in Python is to open a file in exclusive mode... without shared access. As far as I know, when opening a file using the I think that you will need to use the low-level The file open request can look like this.
|
@adiroiban I'm having issues with low-level API since shared path contains spaces (or maybe UTF-8 symbols). Meanwhile high-level API works fine. e.g. share could be like "\server\share dir\test П" |
With all the obfuscation and just a screenshot, it's hard to troubleshoot this. Please provide a short but complete example which demonstrates the problem. |
if you mean the full example, then this would be easiest way:
This step Meanwhile you could easily do access files/dirs in this path using high-level api |
Sorry I didn't reply earlier as I was away on leave. The SMB protocol is typically modelled after the Windows sharing mechanism used on Windows. This means that if a file is opened by another process (locally or also through SMB) then the existing and new handle needs to be opened with the required file share flags. In this case you can use the low level API to open the file handle but luckily the high level API also provides a way to open with custom share flags. The smbprotocol/src/smbclient/_os.py Lines 361 to 367 in 2ce49ef
In this case if you want to open it with read file share then you can do
While you don't need the low level API as |
@jborean93
I believe it's a bug.
|
My apologies I missed that you tried the |
Looks like it also allows write share access so try adding |
When trying to read bytes from file using share access flag
or without flag
or simply copy file to read it afterwards using smbutils
I'm getting error:
The process cannot access the file because it is being used by another process
Meanwhile I could
But can't access in python programm in linux with the above exception
It's nearly impossible to read files that are constantly used and shared by many people
The text was updated successfully, but these errors were encountered: