elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Add File.absname and ensure File.expand_path expands paths starting with ~

Open josevalim opened this issue 13 years ago • 11 comments

josevalim avatar Jan 11 '13 09:01 josevalim

We should also rename File.split and File.join to File.split_path and File.join_path for consistency.

josevalim avatar Jan 11 '13 18:01 josevalim

I would strongly advise deprecation cycle here. I use File.join extensively.

P.S. Personally I find join_path a little bit too long. Filename.join may be?

On Fri, Jan 11, 2013 at 10:38 AM, José Valim [email protected]:

We should also rename File.split and File.join to File.split_path and File.join_path for consistency.

— Reply to this email directly or view it on GitHubhttps://github.com/elixir-lang/elixir/issues/757#issuecomment-12157450.

yrashk avatar Jan 12 '13 00:01 yrashk

Of course it will be deprecated first, I don't know where you get such ideas. ;)

File.join_path is one character longer than Filename.join. Another option is File.joinname, that would be compatible with absname and friends. Another option is to keep it as File.join and rename File.expand_path to File.expand.

José Valim www.plataformatec.com.br Founder and Lead Developer *

josevalim avatar Jan 12 '13 08:01 josevalim

+1 for the second option :+1:

pedrosnk avatar Jan 12 '13 08:01 pedrosnk

I vote for File.expand

On Sat, Jan 12, 2013 at 12:39 AM, pedrosnk [email protected] wrote:

+1 for the second option [image: :+1:]

— Reply to this email directly or view it on GitHubhttps://github.com/elixir-lang/elixir/issues/757#issuecomment-12175424.

yrashk avatar Jan 12 '13 08:01 yrashk

For completeness, the reason I don't like File.split, File.join and File.expand is because they are all UNIX utilities names and could be sources of confusion.

Another option is to create a module called Path (instead of the longer Filename), inspired by Python, that would hold Path.expand, Path.absname, Path.split and friends.

josevalim avatar Jan 12 '13 09:01 josevalim

I like Path

yrashk avatar Jan 12 '13 09:01 yrashk

Yes, a Path module seems like a good idea. Basically every other language has a path module in some form.

alexrp avatar Jan 12 '13 19:01 alexrp

:+1: for Path

guedes avatar Jan 12 '13 20:01 guedes

+1 for Path

meh avatar Jan 12 '13 20:01 meh

:100:

devinus avatar Jan 14 '13 00:01 devinus