Files & processes · BUILT-IN MODULE
file
File reading, writing, copy, move, and directory helpers.
Quick start
use file
text = try file.read "notes.txt"
say text
try file.write "copy.txt" textAPI reference
file.read pathRead a file. Fallible.
讀取檔案。此操作可能失敗。
file.write path textWrite a file. Fallible.
寫入檔案。此操作可能失敗。
file.append path textAppend Text to a file. Fallible.
將 Text 追加到檔案。此操作可能失敗。
file.open pathOpen a file handle. Fallible.
開啟檔案 handle。此操作可能失敗。
file.copy source targetCopy a file. Fallible.
複製檔案。此操作可能失敗。
file.move source targetMove or rename a path. Fallible.
移動或重新命名路徑。此操作可能失敗。
file.copytree source targetRecursively copy a directory. Fallible.
遞迴複製目錄。此操作可能失敗。
file.remove pathRemove a file or directory tree. Fallible.
移除檔案或整個目錄樹。此操作可能失敗。
file.mkdir pathCreate directories. Fallible.
建立目錄。此操作可能失敗。