home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / languages / tcl / !tcldoc / doc / RiscOS / open < prev    next >
Encoding:
Text File  |  1996-01-17  |  2.8 KB  |  85 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/open.n,v 1.1 93/05/10 17:10:32 ouster Exp $ SPRITE (Berkeley)
  22. '\"  Modified for RISCOS by C.T.Stretch Mon,15 Aug 1994
  23. '\" 
  24. .so man.macros
  25. .HS open tcl 7.0
  26. .BS
  27. '\" Note:  do not modify the .SH NAME line immediately below!
  28. .SH NAME
  29. open \- Open a file
  30. .SH SYNOPSIS
  31. .VS
  32. \fBopen \fIfileName\fR ?\fIaccess\fR?
  33. .VE
  34. .BE
  35.  
  36. .SH DESCRIPTION
  37. .PP
  38. This command opens a file and returns an identifier
  39. that may be used in future invocations
  40. of commands like \fBread\fR, \fBputs\fR, and \fBclose\fR.
  41. \fIFileName\fR gives the name of the file to open;
  42. .PP
  43. The \fIaccess\fR argument indicates the way in which the file
  44.  is to be accessed.
  45. .VS
  46. It is a string in the form that would be
  47. passed to the \fBfopen\fR library procedure.
  48. It defaults to ``\fBrb\fR''.
  49. \fIAccess\fR may have any of the following values:
  50. .VE
  51. .TP 15
  52. \fBr\fR
  53. Open the file for reading only; the file must already exist.
  54. .TP 15
  55. \fBr+\fR
  56. Open the file for both reading and writing; the file must
  57. already exist.
  58. .TP 15
  59. \fBw\fR
  60. Open the file for writing only.  Truncate it if it exists.  If it doesn't
  61. exist, create a new file.
  62. .TP 15
  63. \fBw+\fR
  64. Open the file for reading and writing.  Truncate it if it exists.
  65. If it doesn't exist, create a new file.
  66. .TP 15
  67. \fBa\fR
  68. Open the file for writing only.  The file must already exist, and the file
  69. is positioned so that new data is appended to the file.
  70. .TP 15
  71. \fBa+\fR
  72. Open the file for reading and writing.  If the file doesn't exist,
  73. create a new empty file.
  74. Set the initial access position  to the end of the file.
  75. .PP
  76. Any of the above can be opened for binary access by adding a \fBb\fR to
  77. the access string.
  78. .PP
  79. If a file is opened for both reading and writing then \fBseek\fR
  80. must be invoked between a read and a write, or vice versa.
  81.  
  82. .SH KEYWORDS
  83. access mode, append, create, file,
  84. non-blocking, open, permissions
  85.