question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Read/Write on a network folder

See original GitHub issue

I 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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xoofxcommented, Jun 12, 2020

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.

0reactions
guillaume86commented, Jun 12, 2020

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found