Files & processes · BUILT-IN MODULE

path

Filesystem path helpers.

Quick start

use path
use path

file = path.join "data" "users.json"
say file
say path.ext file
say path.exists file

API reference

path.join part...

Join one or more path parts.

合併一個或多個路徑片段。
path.name path

Return the final path component.

回傳路徑最後一個元件。
path.ext path

Return the extension.

回傳副檔名。
path.parent path

Return the parent path.

回傳父層路徑。
path.exists path

Check whether a path exists.

檢查路徑是否存在。
path.is_file path

Check whether a path is a file.

檢查路徑是否為檔案。
path.is_dir path

Check whether a path is a directory.

檢查路徑是否為目錄。