Read/Write on a network folder
See original GitHub issueI would like to read and write on a folder placed on a shared storage using the SubFileSystem
. Is this possible? I can’t seem to find the way, I always get the exception:
A path on Windows must start by /mnt/ followed by the drive letter.
Also, I’d like to be compatible with both Windows and Linux.
This is the code I have:
UPath root = "\\\\myserver\\PublicFolder\\";
var fs = new PhysicalFileSystem();
if (!fs.DirectoryExists(root))
{
fs.CreateDirectory(root);
}
var subfs = new SubFileSystem(fs, root);
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How can I browse a network drive I have read-write access ...
You could right click the share you wish to access as read only select Map network drive. it will assign a drive letter...
Read more >Assign access permission on a shared folder - Microsoft Q&A
I create a shared folder \server\common on Windows Server 2019 and allow all users to have read/write permission. I map this shared folder...
Read more >Access file and read/write from shared/network folder using ...
i want to read and write data from network folder, so far i have tried os.open("\u drive path") , open("\u drive path") but...
Read more >The Network Drive Is Read-Only
Users are able to read the files and the content of folders, but they cannot edit any of the directory's structure, files or...
Read more >Can read but not write on shared folder
Go to Control Panel\All Control Panel Items\Network and Sharing Centre\Advanced sharing settings. Under All Networks, turn off Password ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The integration into PhysicalFileSystem doesn’t match. A unc is like an http connection where you have the host and the path inside it. I would prefer a
new UncFileSystem("\\\\myserver\\PublicFolder\\")
is introduced even if it requires to move some parts of PhysicalFileSystem to a base class. Note also that it might require to disable the file watcher API for this one. I don’t have time, nor any personal interest in this feature, but a PR is welcome.Maybe a
/unc/
root path could handle that on windows platforms? Just translating itself to\\
when transformed into a native path similarly to what /mnt/ is doing for mounted drives.@xoofx any remarks/recommendations if someone was to tackle that?