Include("//111.1.1.1/drive\$/.../test.jl") from network disc on Windows

Hey guys,

happy julia con :slight_smile:

How would I include() from a network disc like:

include("C:.../file.jl")
Core.include(Main, "//111.1.1.1/drive\$/.../test.jl")

The second one doesn’t work for me. Any ideas?

Cheers!

This kinda works, but I’m not sure if it’s save to use…

Core.include(Main, "//111.1.1.1/drive\$/.../test.jl")

But not in all cases.

The documented function is Base.include, rather than Core.include, so it’s better to use that one.

That being said, I don’t understand why the module chosen for including the code of a file is something that should have something to do with readdir from a network disc…

Sorry my bad. I have change the post. I need the include. readdir was just a test and it worked.

Base.include does not work with that file path. So I debugged it and Core.include did but not inside other modules.

Could you map the network drive in explorer (net use y:\ \\111.1.1.1\drive).
Maybe that would help?

Actually the code you have does not work for me anyway.
Is there an Base.include function that takes a module as argument?

julia> include(Main,"c:\\temp\\test.jl")
ERROR: MethodError: no method matching include(::Module, ::String)
You may have intended to import Base.include
Stacktrace:
 [1] top-level scope at REPL[2]:1

Thanks for your response :+1:
Too many edits^^ It should be:

Core.include(Main, "//111.1.1.1/drive\$/.../test.jl")

With that I’m able to load it sometimes.

ok.
The following works flawlessly for me.

include(raw"\\13.14.15.10\famkoenig\temp\test.jl") 
1 Like

Yes, but that method is not exported, so you have to call it as Base.include.