get the absolute path from a relative path in Tcl
Asked Answered
C

1

6

Say I have a file, named ./ko
I want it's full path, which can be (for example) /foo/bar/ko
In Perl, one just does

File::Spec->rel2abs("./ko")

In Ruby, it is:

File.expand_path("./ko")

How is that done in Tcl?

Corollary answered 29/7, 2015 at 7:55 Comment(0)
D
14

Use file normalize:

file normalize ./ko
Downspout answered 29/7, 2015 at 7:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.