跳轉到內容

Rebol 程式設計/write

來自華夏公益教科書,開放的書籍,用於開放的世界

WRITE 目標值 /binary /string /direct /append /no-wait /lines /part 大小 /with 行尾 /allow 訪問 /mode 引數 /custom 引數

寫入檔案、URL 或埠規範(塊或物件)。

WRITE 是一個原生值。

  • 目標 -- (型別:檔案 URL 物件 塊)
  • -- (型別:任何)
  • /binary -- 保留內容完全一致。
  • /string -- 翻譯所有行終止符。
  • /direct -- 在沒有緩衝的情況下開啟埠。
  • /append -- 寫入現有檔案的末尾。
  • /no-wait -- 如果沒有資料,則立即返回,而不等待。
  • /lines -- 將資料處理為行。
  • /part -- 讀取指定數量的資料。
    • 大小 -- (型別:數字)
  • /with -- 指定備用行終止符。
    • 行尾 -- (型別:字元 字串)
  • /allow -- 建立時指定保護屬性。
    • 訪問 -- (型別:塊)
  • /mode -- 以上細化的塊。
    • 引數 -- (型別:塊)
  • /custom -- 允許特殊細化。
    • 引數 -- (型別:塊)

原始碼

[編輯 | 編輯原始碼]
write: native[
    {Writes to a file, url, or port-spec (block or object).} 
    destination [file! url! object! block!] 
    value 
    /binary "Preserves contents exactly." 
    /string "Translates all line terminators." 
    /direct "Opens the port without buffering." 
    /append "Writes to the end of an existing file." 
    /no-wait "Returns immediately without waiting if no data." 
    /lines "Handles data as lines." 
    /part "Reads a specified amount of data." 
    size [number!] 
    /with "Specifies alternate line termination." 
    end-of-line [char! string!] 
    /allow "Specifies the protection attributes when created." 
    access [block!] 
    /mode "Block of above refinements." 
    args [block!] 
    /custom "Allows special refinements." 
    params [block!]
]
華夏公益教科書