LostKobrakai

LostKobrakai

Path module dependency on host OS type

Currently many of the functions in the Path module do depend on the OS type the system is running on. I’m currently working on a filesystem abstraction and there it becomes quite apparent that on my unix system Path.type("D:/usr/local/bin") does return :relative, while it’s an :absolute path on a windows based system. The system is meant to work the same though for windows and unix based deployments and the paths/files handled aren’t even stored on the host machine for most adapters.

I do feel it would make sense to push this implicit dependency on the host os to the api level, so the module can be used to handle paths for other OS’s the same way it can for the OS the system currently runs on.

I’m wondering how others (especially the core team) think about this. Currently the dependency essentially means I can’t use most of the Path module.

First Post!

dimitarvp

dimitarvp

Can you expand on your use case? F.ex. why is it important what does Path.type return on the host OS? Why are Windows paths stored on a UNIX host?

And, what kind of a file system abstraction?

Last Post!

LostKobrakai

LostKobrakai

As soon as you‘re not dealing with paths for your host system, but with paths for external systems you have to deal with path conventions possibly different to your host OS.

I‘m working on a system, which abstracts access to various cloud providers (S3, Dropbox, …), file transfer protocols (SFTP, FTP) or other adapters (lokal fs, in memory fs). To make this sane to deal with each instance is mounted at some root path and the paths of individual files accepted by the api shall be relative and in unix format no matter the host OS or adapter.

Where Next?

Popular in Discussions Top

scouten
I’m looking for a host for the server part of a small (personal) side project that I’m working on. It’s currently written in Node.js and ...
New
AstonJ
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
joeerl
I’m playing with Elixir - It’s fun. I think @rvirding does give Elixir courses these days. Re: files and database - when I given Erlang ...
New
MarioFlach
Hello, I want to share a project I’ve been working on for a while: https://github.com/almightycouch/gitgud Background Some time ago I ...
New
opsb
We’re considering our architecture from a viewpoint of scaling our traffic heavily over the next 6 months. Our current deployment is runn...
New
nunobernardes99
Hi there Elixir friends :vulcan_salute: In a recent task I was on, I needed to check in two dates which of them is the maximum and which...
New
matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

We're in Beta

About us Mission Statement