檔案與目錄存取
**************

本章中描述的 module（模組）用於處理硬碟檔案和目錄。例如，有一些 module
用於讀取檔案的屬性、以可攜 (portable) 方式操作路徑以及建立暫存檔。本章
中的完整 module 清單是：

* "pathlib" --- 物件導向檔案系統路徑

  * 基本用法

  * 例外

  * 純路徑

    * 通用屬性

    * 運算子

    * 對個別組成的存取

    * 方法與屬性

  * 實體路徑

    * 剖析和產生 URI

    * 擴展和解析路徑

    * 查詢檔案類型和狀態

    * 讀取和寫入檔案

    * 讀取目錄

    * 建立檔案和目錄

    * 重新命名和刪除

    * 權限和所有權

  * 模式語言 (pattern language)

  * 與 "glob" 模組的比較

  * 與 "os" 和 "os.path" 模組的比較

    * 對應工具

* "os.path" --- 常見的路徑名操作

* "stat" --- 直譯 "stat()" 的結果

* "filecmp" --- 檔案與目錄比較

  * The "dircmp" class

* "tempfile" --- 生成臨時檔案和目錄

  * 範例

  * 已棄用的函式和變數

* "glob" --- Unix 風格的路徑名稱模式擴展

  * 範例

* "fnmatch" --- Unix 檔案名稱模式比對

* "linecache" --- 隨機存取文字列

* "shutil" — 高階檔案操作

  * Directory and files operations

    * Platform-dependent efficient copy operations

    * copytree 範例

    * rmtree 範例

  * Archiving operations

    * Archiving example

    * Archiving example with *base_dir*

  * Querying the size of the output terminal

也參考:

  Module "os"
     作業系統介面，包括處理比 Python *檔案物件*更低階檔案的函式。

  Module "io"
     Python 的內建 I/O 函式庫，包含抽象類別和一些具體類別 (concrete
     class)，如檔案 I/O。

  內建函式 "open()"
     使用 Python 打開檔案以進行讀寫檔案的標準方法。
