REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: open

open  spec  /new  /read  /write  /seek  /allow  access

Opens a port. Makes a new port from a specification, if necessary.


spec [port! file! url! block!]


/new - Create new file - if it exists, reset it (truncate)

/read - Open for read access

/write - Open for write access

/seek - Optimize for random access

/allow - Specifies protection attributes

access [block!]

See also:

close   load   do   insert   remove   read   write   query  


Opens a port for I/O operations. The value returned from OPEN can be used to examine or modify the data associated with the port. The argument must be a fully-specified port specification, an abbreviated port specification such as a file path or URL, or a block which is executed to modify a copy of the default port specification.

autos: open/new %autos.txt
insert autos "Ford"
insert tail autos " Chevy"
close autos
print read %autos.txt

  TOC < Back Next > - WIP Wiki Feedback Admin