Issue #3356 has been updated by Nobuyoshi Nakada.


You can get the stored name by `File.realpath`, and tell if two files are same by `File.identical?`.

----------------------------------------
Feature #3356: Add GetShortPathName to ruby
https://bugs.ruby-lang.org/issues/3356#change-56249

* Author: Christian Hltje
* Status: Feedback
* Priority: Normal
* Assignee: Usaku NAKAMURA
----------------------------------------
=begin
 Hi!
 
 I use Ruby on windows and it would be really useful to have access to GetShortPathName in ruby.
 
 I have a monkey-patch to add Pathname.shortpath (attached) to demonstrate it.  Probably realpath, etc. should take this in to account as well, since in windows, only the shortpath is canonical.
 
 In addition, the shortpath doesn't need to be escaped, so you can use it with backticks (`), etc.
 
 Ciao!
=end


---Files--------------------------------
pathname-shortpath.rb (640 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>