Ruby 编程/标准库/Pathname
外观
< Ruby 编程
# Pathname represents a pathname which locates a file in a filesystem. ... # It does not represent the file itself. # A Pathname can be relative or absolute. It's not until you try to # reference the file that it even matters whether the file exists or not. # The value of this class is to manipulate file path information in a neater # way than standard Ruby provides. The examples below demonstrate the # difference. *All* functionality from File, FileTest, and some from Dir and # FileUtils is included, in an unsurprising way. It is essentially a facade for # all of these, and more.
要使用它
require 'pathname'