跳转至内容

Ruby 编程/标准库/Pathname

来自 Wikibooks,开放世界开放书籍
# 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'
华夏公益教科书