Jump to content

Sys2Open: Difference between revisions

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

Latest revision as of 06:39, 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

  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

File handle, or "" in case of error.