Files & processes · BUILT-IN MODULE
path
Filesystem path helpers.
Quick start
use path
file = path.join "data" "users.json"
say file
say path.ext file
say path.exists fileAPI reference
path.join part...Join one or more path parts.
合併一個或多個路徑片段。
path.name pathReturn the final path component.
回傳路徑最後一個元件。
path.ext pathReturn the extension.
回傳副檔名。
path.parent pathReturn the parent path.
回傳父層路徑。
path.exists pathCheck whether a path exists.
檢查路徑是否存在。
path.is_file pathCheck whether a path is a file.
檢查路徑是否為檔案。
path.is_dir pathCheck whether a path is a directory.
檢查路徑是否為目錄。