Skip to content
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

Add support for Windows network paths #32

Open
jannefiluren opened this issue Aug 16, 2018 · 3 comments
Open

Add support for Windows network paths #32

jannefiluren opened this issue Aug 16, 2018 · 3 comments

Comments

@jannefiluren
Copy link

FilePaths does not seem support Windows network paths at the moment (see this issue on the Julia vs code extension). They typically look like this \\data\... and I would like to add support for them in FilePaths. I would appriciate any hints on how I could do that, and what test I need to add.

@rofinn
Copy link
Owner

rofinn commented Aug 19, 2018

That seems like a great idea! The general plan I had was for folks to implement custom path types in their own packages (e.g., WNPaths.jl, S3Paths.jl, NFSPaths.jl) and just depend on FilePathsBase.jl which I'm hoping will be julia stdlib one day. This will allow other packages to just depend on FilePathsBase.jl and WNPaths.jl without needing FilePaths.jl or its interop dependencies.

As a starting point, I'd recommend looking at the following files for how you might want to define your subtype:

  1. paths.jl - Defines most of the AbstractPath API.
  2. posix.jl - Implements the required AbstractPath interface to allow the rest of the API to work.

If you have any questions or concerns about the AbstractPath interface please file an issue on FilePathsBase.jl.

@jannefiluren
Copy link
Author

Thanks for your reply. I have been looking at the code for a bit right now. I have very little experience with paths overall though, and I am a poor Julia programmer, so apologies for that first.

Should I add a new type, similar to WindowsPath, called for example WindowNetworkPath? Should this type even be a subtype of WindowsPath?

I guess that at this line of code, I would have to create a WindowsNetworkPath?

Am I on the right track at all?

@rofinn
Copy link
Owner

rofinn commented Aug 19, 2018

I would make WindowsNetworkPath (or UNCPath) a subtype of AbstractPath because WindowsPath is already a concrete type and I don't expect a lot of the WindowsPath methods to work for UNCPaths. I think that we'll want define a registration system for calling Path (or using the p_str macro) and having it automatically detect things like UNCPaths, but that shouldn't be necessary for you to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants