Jump to content

Sys2Open: Difference between revisions

From EDM2
Ak120 (talk | contribs)
m Ak120 moved page RxUtilEx - Sys2Open to Sys2Open
Ak120 (talk | contribs)
mNo edit summary
Line 3: Line 3:
==Arguments==
==Arguments==
REXX ARGUMENTS:
REXX ARGUMENTS:
  1. Name of file or stream to open.                           (REQUIRED)
# Name of file or stream to open. (REQUIRED)
  2. Open action flags, must be either "O" (open if exists), "R" (replace
# Open action flags, must be either "O" (open if exists), "R" (replace if exists), or nothing (fail if exists), optionally followed by "C" (create if file does not exist). If "C" is not specified, the operation will fail if the file does not exist. Note that a value of "" alone will therefore fail automatically. (DEFAULT: "O")<br/>In summary, the possible combinations are:
    if exists), or nothing (fail if exists), optionally followed by "C"
#:O = Open only (if file exists, open it; if not, fail)
    (create if file does not exist). If "C" is not specified, the
#:OC= Open/create (if file exists, open it; if not, create it)
    operation will fail if the file does not exist. Note that a value
#:R = Replace only (if file exists, replace it; if not, fail)
    of "" alone will therefore fail automatically.       (DEFAULT: "O")
#:RC= Replace/create (if file exists, replace it; if not, create it)
    In summary, the possible combinations are:
#:C = Create only (if file exists, fail; if not, create it)
      O = Open only (if file exists, open it; if not, fail)
#:(empty) = No-op (if file exists, fail; if not, fail)
      OC= Open/create (if file exists, open it; if not, create it)
# Access mode flags, one or both of: (DEFAULT: "RW")
      R = Replace only (if file exists, replace it; if not, fail)
#:R = Open file with read access.
      RC= Replace/create (if file exists, replace it; if not, create it)
#:W = Open file with write access.
      C = Create only (if file exists, fail; if not, create it)
# Sharing mode flags, any combination of: (DEFAULT: "W")
      (empty) = No-op (if file exists, fail; if not, fail)
#:R = Deny read access to other processes
  3. Access mode flags, one or both of:                   (DEFAULT: "RW")
#:W = Deny write access to other processes
      R = Open file with read access.
# Deny legacy DosOpen access, one of:
      W = Open file with write access.
#:0 = Allow DosOpen to access the file (DEFAULT)
  4. Sharing mode flags, any combination of:               (DEFAULT: "W")
#:1 = Deny access using the DosOpen API
      R = Deny read access to other processes
# Privacy/inheritance flag, one of:
      W = Deny write access to other processes
#:0 = The file handle is inherited by child processes. (DEFAULT)
  5. Deny legacy DosOpen access, one of:
#:1 = The file handle is private to the current process.
      0 = Allow DosOpen to access the file                     (DEFAULT)
# Initial file attributes when creating a file: (DEFAULT: "")
      1 = Deny access using the DosOpen API
#:A = Archive attribute set
  6. Privacy/inheritance flag, one of:
#:D = Directory attribute set
      0 = The file handle is inherited by child processes.     (DEFAULT)
#:S = System attribute set
      1 = The file handle is private to the current process.
#:H = Hidden attribute set
  7. Initial file attributes when creating a file:         (DEFAULT: "")
#:R = Read-only attribute set
      A = Archive attribute set
# Initial file size when creating or replacing a file; ignored if access mode is read-only. (DEFAULT: 0)
      D = Directory attribute set
# I/O mode flags, any or all of: (DEFAULT: "")
      S = System attribute set
#:T = Write-through mode (default is normal write)
      H = Hidden attribute set
#:N = No-cache mode (default is to use filesystem cache)
      R = Read-only attribute set
#:S = Sequential access
  8. Initial file size when creating or replacing a file; ignored if
#:R = Random access
    access mode is read-only.                               (DEFAULT: 0)
#: * S and R can combine as follows:
  9. I/O mode flags, any or all of:                         (DEFAULT: "")
#::Neither: No locality known (default)
      T = Write-through mode (default is normal write)
#::S only: Mainly sequential access
      N = No-cache mode (default is to use filesystem cache)
#::R only: Mainly random access
      S = Sequential access
#::Both: Random/sequential (i.e. random with some locality)
      R = Random access
        * S and R can combine as follows:
            Neither: No locality known (default)
            S only: Mainly sequential access
            R only: Mainly random access
            Both:   Random/sequential (i.e. random with some locality)


==Return Value==
==Return Value==
REXX RETURN VALUE:
REXX RETURN VALUE: File handle, or "" in case of error.
  File handle, or "" in case of error.


[[Category:RxUtilEx]]
[[Category:RxUtilEx]]

Revision as of 04:47, 3 May 2020

Opens a file or other stream; files larger than 2GB are supported (this function is a wrapper to DosOpenL). Direct-DASD mode is not supported by this function, nor is setting the initial extended attributes.

Arguments

REXX ARGUMENTS:

  1. Name of file or stream to open. (REQUIRED)
  2. Open action flags, must be either "O" (open if exists), "R" (replace if exists), or nothing (fail if exists), optionally followed by "C" (create if file does not exist). If "C" is not specified, the operation will fail if the file does not exist. Note that a value of "" alone will therefore fail automatically. (DEFAULT: "O")
    In summary, the possible combinations are:
    O = Open only (if file exists, open it; if not, fail)
    OC= Open/create (if file exists, open it; if not, create it)
    R = Replace only (if file exists, replace it; if not, fail)
    RC= Replace/create (if file exists, replace it; if not, create it)
    C = Create only (if file exists, fail; if not, create it)
    (empty) = No-op (if file exists, fail; if not, fail)
  3. Access mode flags, one or both of: (DEFAULT: "RW")
    R = Open file with read access.
    W = Open file with write access.
  4. Sharing mode flags, any combination of: (DEFAULT: "W")
    R = Deny read access to other processes
    W = Deny write access to other processes
  5. Deny legacy DosOpen access, one of:
    0 = Allow DosOpen to access the file (DEFAULT)
    1 = Deny access using the DosOpen API
  6. Privacy/inheritance flag, one of:
    0 = The file handle is inherited by child processes. (DEFAULT)
    1 = The file handle is private to the current process.
  7. Initial file attributes when creating a file: (DEFAULT: "")
    A = Archive attribute set
    D = Directory attribute set
    S = System attribute set
    H = Hidden attribute set
    R = Read-only attribute set
  8. Initial file size when creating or replacing a file; ignored if access mode is read-only. (DEFAULT: 0)
  9. I/O mode flags, any or all of: (DEFAULT: "")
    T = Write-through mode (default is normal write)
    N = No-cache mode (default is to use filesystem cache)
    S = Sequential access
    R = Random access
    * S and R can combine as follows:
    Neither: No locality known (default)
    S only: Mainly sequential access
    R only: Mainly random access
    Both: Random/sequential (i.e. random with some locality)

Return Value

REXX RETURN VALUE: File handle, or "" in case of error.