open
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | open [2012/07/04 06:30] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | # $EPIC: open.txt,v 1.5 2012/07/04 06:30:23 jnelson Exp $ | ||
+ | ======Synopsis: | ||
+ | $__open__(%%< | ||
+ | |||
+ | ======Technical: | ||
+ | Important: The %%< | ||
+ | different from most functions. | ||
+ | |||
+ | This opens a file for reading from the beginning, or writing to the end. | ||
+ | |||
+ | The return value is a file descriptor you can pass to [[read]] or [[write]] | ||
+ | and eventually [[close]]. | ||
+ | |||
+ | This functions allows the client to open an arbitrary file for reading or | ||
+ | writing. | ||
+ | descriptor for the open file; the file descriptor is an integer. | ||
+ | expansion is permitted. | ||
+ | |||
+ | ======Practical: | ||
+ | The $__open__() function is the doorway to external file access from | ||
+ | within the client (aside from [[exec command|EXEC]]ing a process). | ||
+ | Assuming the file has the appropriate permissions, | ||
+ | the file for read or write access (but not both). | ||
+ | appends to the file, so you'll need to use $[[unlink]]() or | ||
+ | $[[rename]]() if you want to start fresh. | ||
+ | |||
+ | ======Returns: | ||
+ | file descriptor, or -1 if error | ||
+ | |||
+ | ======Options: | ||
+ | | | ||
+ | | | ||
+ | |||
+ | ======Examples: | ||
+ | < | ||
+ | $open(~/ | ||
+ | $open(~/ | ||
+ | $open(/ | ||
+ | </ | ||
open.txt · Last modified: 2012/07/04 06:30 by 127.0.0.1