Is there a built-in method in Ruby to convert a Windows short path like
C:\PROGRA~2\MICROS~1.0\VC\bin\amd64
into its corresponding long path
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64
I've tried
File.expand_path(short_path)
Pathname.new(short_path).cleanpath
Pathname.new(short_path).realpath
Dir.chdir(short_path) { Dir.pwd }
but none of these worked.
If possible, I'd like to avoid calling the Win32 API directly like in this answer, or ugly work-arounds like spawning PowerShell:
%x{powershell (Get-Item -LiteralPath #{short_path}).FullName}