Project

General

Profile

Actions

Bug #14406

closed

File.expand_path doesn't expand tilde inside Windows home directory

Added by abotalov (Andrei Botalov) almost 7 years ago. Updated almost 7 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:85132]

Description

TMP environment variable on Windows is set to a name that contains a tilde. File.expand_path doesn't currently return an expanded name. I would expect it to do so as its documentation says:
"Converts a pathname to an absolute pathname."
"The given pathname may start with a “~”, which expands to the process owner's home directory"

Example on my system:

irb(main):085:0> File.expand_path(Dir.tmpdir)
=> "C:/Users/ANDREI~1/AppData/Local/Temp"
irb(main):086:0> File.absolute_path(Dir.tmpdir)
=> "C:/Users/ANDREI~1/AppData/Local/Temp"
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0