1# $EPIC: open,v 1.3 2003/12/05 12:15:40 brian Exp $
2Synopsis:
3   $open(<file> R|W)
4
5Technical:
6   This functions allows the client to open an arbitrary file for reading or
7   writing.  Write mode appends to the file.  The function returns a file
8   descriptor for the open file; the file descriptor is an integer.  Tilde-
9   expansion is permitted.
10
11Practical:
12   The $open() function is the doorway to external file access from within
13   the client (aside from EXECing a process).  Assuming the file has the
14   appropriate permissions, it allows you to open the file for read or
15   write access (but not both).  Write access only appends to the file, so
16   you'll need to use $unlink() or $rename() if you want to start fresh.
17
18Returns:
19   file descriptor, or -1 if error
20
21Options:
22   R   open file for reading
23   W   open file for writing
24
25Examples:
26   $open(~/.ircrc W)                 open your .ircrc for writing
27   $open(~/.irclog R)                open your logfile for reading
28   $open(/etc/passwd W)              will probably fail
29
30See Also:
31   close(6); randread(6); read(6); rename(6); unlink(6);
32   write(6); writeb(6)
33
34