CharlesO

CharlesO

Unable to access files in windows shared directory

I get the following error, when I try to access files in windows shared directory:
(I can view the directory in file explorer, so I know it is not a permission issue)

Erlang/OTP 21 [erts-10.1] [64-bit] [smp:6:6] [ds:6:6:10] [async-threads:1]

Interactive Elixir (1.7.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> s =  ~S"\\flsv\Finance_Dept\FUND ACCOUNTING UNIT\\27112018"   
"\\\\flsv\\Finance_Dept\\FUND ACCOUNTING UNIT\\27112018"
iex(2)> s = "//flsv/Finance_Dept/FUND ACCOUNTING UNIT/27112018/"  
"//flsv/Finance_Dept/FUND ACCOUNTING UNIT/27112018/"
iex(3)> File.ls s
{:error, :enoent}

Most Liked

OvermindDL1

OvermindDL1

I’m not sure the BEAM would support UNC Paths, I’m pretty sure it only supports File Paths. You’d probably need to map the drive.

There might be some functions that accidentally do, but I doubt most would.

However, a NIF or Port could easily work around that by supplying a replacement File module (UNCFile maybe?).

The other bet would be to send a PR to the BEAM Erlang core to fix it’s underlying library (which I think they’d accept since many of the functions work anyway).

OvermindDL1

OvermindDL1

No, UNC is purely a Windows invention. The rest of the world uses URI’s. Given a UNC path like "\flsv\Finance_Dept\FUND ACCOUNTING UNIT\27112018the URI version would befile://flsv/Finance_dept/FUND%20ACCOUNTING%20UNIT/27112018`, which ‘is’ supported by unix’s via their extended interfaces (the root posix interfaces support only filepath syntax, I’m pretty sure the BEAM uses the posix calls).

You know how Windows always has to not follow standards, invent their own thing (why do you think they chose \ as the path separator instead of the already standardized /. :wink: .)

CharlesO

CharlesO

I just found this:

OTP-15333    Application(s): erts
                Related Id(s): ERL-737

                File access through UNC paths works again on Windows.
                This regression was introduced in OTP 21.

Where Next?

Popular in Questions Top

_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
greenz1
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement