home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man2 / open.2 < prev    next >
Encoding:
Text File  |  1975-06-26  |  913 b   |  51 lines

  1. .th OPEN II 8/5/73
  2. .sh NAME
  3. open \*- open for reading or writing
  4. .sh SYNOPSIS
  5. (open = 5.)
  6. .br
  7. .ft B
  8. sys open; name; mode
  9. .br
  10. .ft R
  11. (file descriptor in r0)
  12. .s3
  13. .ft B
  14. open(name, mode)
  15. .br
  16. char *name;
  17. .ft R
  18. .sh DESCRIPTION
  19. .it Open
  20. opens the file
  21. .it name
  22. for reading
  23. (if
  24. .it mode
  25. is 0),
  26. writing (if
  27. .it mode
  28. is 1) or for both reading and writing
  29. (if
  30. .it mode
  31. is 2).
  32. .it Name
  33. is the address of a string of ASCII characters representing
  34. a path name, terminated by a null character.
  35. .s3
  36. The returned file descriptor should be saved for subsequent calls
  37. to
  38. .it read,
  39. .it write,
  40. and
  41. .it close.
  42. .sh "SEE ALSO"
  43. creat (II), read (II), write (II), close (II)
  44. .sh DIAGNOSTICS
  45. The error bit
  46. (c-bit) is set if the file does not exist,
  47. if one of the necessary directories
  48. does not exist or is unreadable, if the file is not
  49. readable (resp. writable), or if too many files are open.
  50. From C, a \*-1 value is returned on an error.
  51.