Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: JRuby 1.0.2, JRuby 1.1b1
-
Component/s: Core Classes/Modules
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
File.dirname('C:\Temp') returns 'C:' when it should return 'C:
'
Patch corrects this (and also returns a path with the slashes pointing the original direction per MRI)
Attachments
Issue Links
| This issue is related to: | ||||
| JRUBY-1401 | Pathname#realpath fails for Windows drive letters |
|
|
|
This is a tricky area for us. C Ruby changes its behavior to support windows in ways that would break code on other platforms. In order for us to provide a single binary that runs everywhere, we need to be able to recognize that we're on a Windows platform and provide different behavior. This appear to be one of those cases:
~/NetBeansProjects/jruby-1_0 $ ruby -e "p File.dirname('C:\Temp')" "." ~/NetBeansProjects/jruby-1_0 $ ruby -e "p File.dirname('C:/Temp')" "C:"Can you look into a way to do this conditionally depending on whether we're on Windows or not?
~/NetBeansProjects/jruby-1_0 $ ruby -e "p File.dirname('C:\Temp')" "." ~/NetBeansProjects/jruby-1_0 $ ruby -e "p File.dirname('C:/Temp')" "C:"