Jump to content

Rebol Programming/open-events

From Wikibooks, open books for an open world

USAGE:

[edit | edit source]
OPEN spec /binary /string /direct /seek /new /read /write /no-wait /lines /with end-of-line /allow access /mode args /custom params /skip length 

DESCRIPTION:

[edit | edit source]

Opens a new port connection.

OPEN is a native value.

ARGUMENTS:

[edit | edit source]
  • spec -- (Type: file url port object block)

REFINEMENTS:

[edit | edit source]
  • /binary -- Preserves contents exactly.
  • /string -- Translates all line terminators.
  • /direct -- Opens the port without buffering.
  • /seek -- Opens port in seek mode without buffering.
  • /new -- Creates a file. (Need not already exist.)
  • /read -- Read only. Disables write operations.
  • /write -- Write only. Disables read operations.
  • /no-wait -- Returns immediately without waiting if no data.
  • /lines -- Handles data as lines.
  • /with -- Specifies alternate line termination.
    • end-of-line -- (Type: char string)
  • /allow -- Specifies the protection attributes when created.
    • access -- (Type: block)
  • /mode -- Block of above refinements.
    • args -- (Type: block)
  • /custom -- Allows special refinements.
    • params -- (Type: block)
  • /skip -- Skips a number of bytes.
    • length -- (Type: number)

SOURCE CODE

[edit | edit source]
open: native[
    "Opens a new port connection." 
    spec [file! url! port! object! block!] 
    /binary "Preserves contents exactly." 
    /string "Translates all line terminators." 
    /direct "Opens the port without buffering." 
    /seek "Opens port in seek mode without buffering." 
    /new "Creates a file. (Need not already exist.)" 
    /read "Read only. Disables write operations." 
    /write "Write only.  Disables read operations." 
    /no-wait "Returns immediately without waiting if no data." 
    /lines "Handles data as lines." 
    /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!] 
    /skip "Skips a number of bytes." 
    length [number!]
]