跳轉至內容

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'
華夏公益教科書