I$Open

From NitrOS-9
Jump to: navigation, search
Open Path Opens a path to an existing file or device as specified by the pathlist
OS9 I$Open 103F 84

Entry Conditions

A access mode (D S PE PW PR E W R)

X address of the pathlist

Exit Conditions

A path number

X address of the last byte of the pathlist + 1; skips any trailing blanks

Error Output

CC carry set on error

B error code, if any

Additional Information

  • NitrOS-9 searches for the file in one of the following:
    • The directory specified by the pathlist if the pathlist begins with a slash.
    • The working data directory, if the pathlist does not begin with a slash.
    • The working execution directory, if the pathlist does not begin with a slash and if the execution bit is set in the access mode.
  • NitrOS-9 returns a path number for later system calls to use to identify the file.
  • The access mode parameter lets you specify which read and/or write operations are to be permitted. When set, each access mode bit enables one of the following: Write, Read, Read and Write, Update, Directory I/O.
  • The access mode must conform to the access permission attributes associated with the file or device. (See the Create system call.) Only the owner can access a file unless the appropriate public permission bits are set.
  • The update mode might be slightly slower than the others because it might require pre-reading of sectors for random access of bytes within sectors.
  • Several processes (users) can open files at the same time. Each device has an attribute that specifies whether or not it is shareable.
  • If the single-user bit is set, the file opened for singer-user access regardless of the settings of the file’s permission bits.
  • You must open directory files for read or write if the directory bit (Bit 7) is set in the access mode.
  • Open Path always uses the lowest path number available for the process.