File¶
File.basename [TODO]¶
Fixed on MS Windows. It previously did not handle UNC paths properly.
File.dirname [TODO]¶
Fixed on MS Windows. It previously did not handle UNC paths properly.
MRI also contains inconsistencies with regards to path normalization. It strips extra leading slashes, but leaves others.
For example:
File.dirname("////foo//bar/baz") # => /foo//bar (MRI)
Sapphire will normalize all paths.
File.expand_path [TODO]¶
The "~user" notation is now supported on Windows.
File.file?¶
Fixed on MS Windows. It previously returned the wrong result if called on a directory.
File.size? [TODO]¶
Returns true or false instead of nil or a size.
File.split [TODO]¶
The semantics for splitting a root path were never clearly defined, and didn't work at all on MS Windows. It is now defined as follows:- If the argument is a root path, it will return the root path as the first element and an empty string as the second element.
- In all other cases it returns the directory name as the first element, and the basename as the second element.
- C:\
- \\server\share
- \\server
On both platforms, all trailing slashes will be stripped before determining whether or not a path is a root path.