| [4] | 1 | FUNCTIONS IN RXUTILEX.DLL
 | 
|---|
 | 2 | 
 | 
|---|
 | 3 | (See file 'TODO' for functions which are under consideration to be added.)
 | 
|---|
 | 4 | 
 | 
|---|
| [19] | 5 | Sys2CheckNamedPipe          - Check the status of a named pipe (server side)
 | 
|---|
| [17] | 6 | Sys2Close                   - Close a file or named pipe
 | 
|---|
| [16] | 7 | Sys2ConnectNamedPipe        - Enable client sessions on a named pipe
 | 
|---|
 | 8 | Sys2CreateNamedPipe         - Create a named pipe
 | 
|---|
 | 9 | Sys2DisconnectNamedPipe     - Acknowledge that a named pipe session has ended
 | 
|---|
| [4] | 10 | Sys2DropFuncs               - Deregister all functions
 | 
|---|
| [21] | 11 | Sys2FormatNumber            - Format a number with thousands-grouping characters
 | 
|---|
| [4] | 12 | Sys2FormatTime              - Format calender time (strftime wrapper)
 | 
|---|
 | 13 | Sys2GetClipboardText        - Retrieve the current clipboard text
 | 
|---|
 | 14 | Sys2GetEpochTime            - Get or convert calender time (seconds from epoch)
 | 
|---|
 | 15 | Sys2KillProcess             - Kill a process by name or PID
 | 
|---|
 | 16 | Sys2LoadFuncs               - Register all functions
 | 
|---|
 | 17 | Sys2LocateDLL               - Search for a loaded/loadable DLL
 | 
|---|
| [17] | 18 | Sys2Open                    - Open a file or stream (with >2GB support)
 | 
|---|
| [4] | 19 | Sys2PutClipboardText        - Copy a text string to the clipboard
 | 
|---|
 | 20 | Sys2QueryForegroundProcess  - Get the PID of the current foreground process
 | 
|---|
 | 21 | Sys2QueryPhysicalMemory     - Get the amount of installed RAM
 | 
|---|
 | 22 | Sys2QueryProcess            - Get information about a process
 | 
|---|
 | 23 | Sys2QueryProcessList        - Get the list of running processes
 | 
|---|
| [17] | 24 | Sys2Read                    - Read bytes from a file or named pipe
 | 
|---|
| [4] | 25 | Sys2ReplaceModule           - Unlock a DLL (DosReplaceModule wrapper)
 | 
|---|
| [17] | 26 | Sys2Seek                    - Set file read/write pointer (with >2GB support)
 | 
|---|
| [4] | 27 | Sys2Version                 - Get the version of this library
 | 
|---|
| [17] | 28 | Sys2Write                   - Write bytes to a file or named pipe
 | 
|---|
| [4] | 29 | 
 | 
|---|
 | 30 | 
 | 
|---|
 | 31 | If an internal error occurs in any function, the variable SYS2ERR will contain
 | 
|---|
| [16] | 32 | an error message of the form "RC: description" where RC is a non-zero error
 | 
|---|
| [4] | 33 | code, and description indicates the internal function call that failed.  If
 | 
|---|
 | 34 | no error occurs, SYS2ERR will be "0".
 | 
|---|
 | 35 | 
 | 
|---|
 | 36 | 
 | 
|---|
 | 37 | -------------------------------------------------------------------------
 | 
|---|
| [16] | 38 | Sys2CheckNamedPipe
 | 
|---|
 | 39 | 
 | 
|---|
| [19] | 40 | Checks the status of a named pipe that was previously created using
 | 
|---|
 | 41 | Sys2CreateNamedPipe.  
 | 
|---|
| [16] | 42 | 
 | 
|---|
| [19] | 43 | This function is designed for use by the process that created the pipe 
 | 
|---|
 | 44 | (i.e. the server side).  Clients which are accessing a named pipe should 
 | 
|---|
 | 45 | use the standard REXX STREAM and/or CHARS functions to determine the 
 | 
|---|
 | 46 | pipe's status.
 | 
|---|
 | 47 | 
 | 
|---|
| [16] | 48 | REXX ARGUMENTS:
 | 
|---|
 | 49 |   1. The pipe handle (from Sys2CreateNamedPipe or DosOpen).  (REQUIRED)
 | 
|---|
 | 50 | 
 | 
|---|
 | 51 | REXX RETURN VALUE:
 | 
|---|
 | 52 |   String of the format "bytes status", where bytes is the number of bytes
 | 
|---|
 | 53 |   currently waiting in the pipe, and status is one of: DISCONNECTED,
 | 
|---|
 | 54 |   LISTENING, CONNECTED, or CLOSING.
 | 
|---|
 | 55 | 
 | 
|---|
 | 56 | 
 | 
|---|
 | 57 | -------------------------------------------------------------------------
 | 
|---|
| [17] | 58 | Sys2Close
 | 
|---|
 | 59 | 
 | 
|---|
 | 60 | Close a file or stream (wrapper to DosClose).
 | 
|---|
 | 61 | 
 | 
|---|
 | 62 | REXX ARGUMENTS:
 | 
|---|
 | 63 |   1. File handle (returned by Sys2Open).  (REQUIRED)
 | 
|---|
 | 64 | 
 | 
|---|
 | 65 | REXX RETURN VALUE:
 | 
|---|
 | 66 |   1 on success, or 0 if an error occurred.
 | 
|---|
 | 67 | 
 | 
|---|
 | 68 | 
 | 
|---|
 | 69 | -------------------------------------------------------------------------
 | 
|---|
| [16] | 70 | Sys2ConnectNamedPipe
 | 
|---|
 | 71 | 
 | 
|---|
 | 72 | Start 'listening' by allowing clients to connect to a previously-created
 | 
|---|
 | 73 | named pipe.
 | 
|---|
 | 74 | 
 | 
|---|
 | 75 | REXX ARGUMENTS:
 | 
|---|
 | 76 |   1. The pipe handle, as returned by Sys2CreateNamedPipe.  (REQUIRED)
 | 
|---|
 | 77 | 
 | 
|---|
 | 78 | REXX RETURN VALUE:
 | 
|---|
 | 79 |   1 on success, or 0 if an error occurred.
 | 
|---|
 | 80 | 
 | 
|---|
 | 81 | 
 | 
|---|
 | 82 | -------------------------------------------------------------------------
 | 
|---|
 | 83 | Sys2CreateNamedPipe
 | 
|---|
 | 84 | 
 | 
|---|
| [17] | 85 | Creates a named pipe with the specified name and parameters.  Only byte
 | 
|---|
 | 86 | mode is supported; message mode is not.
 | 
|---|
| [16] | 87 | 
 | 
|---|
 | 88 | Note that the standard REXX functions such as CHARIN/OUT, which operate
 | 
|---|
 | 89 | directly on file names, are not capable of using the pipe handle returned
 | 
|---|
| [19] | 90 | from this function.  While the client end can use such functions after
 | 
|---|
| [17] | 91 | using STREAM to issue an OPEN WRITE or OPEN READ command, the server end
 | 
|---|
| [16] | 92 | needs to use the pipe handle from this function, and must therefore use
 | 
|---|
 | 93 | Sys2Read/Sys2Write in order to read and write data from the pipe.
 | 
|---|
 | 94 | 
 | 
|---|
| [17] | 95 | Named pipes can be created in inbound-only, outbound-only, or duplex
 | 
|---|
 | 96 | (inbound/outbound) mode.  An error will result if attempting to write
 | 
|---|
 | 97 | to an inbound-only pipe, or read from an outbound-only pipe.
 | 
|---|
 | 98 | 
 | 
|---|
 | 99 | To activate a named pipe so that client processes can connect to it, use
 | 
|---|
 | 100 | Sys2ConnectNamedPipe.  To check the pipe's connection status, as well as
 | 
|---|
 | 101 | the amount of data currently in the pipe, use Sys2CheckNamedPipe.  To
 | 
|---|
 | 102 | unlock a named pipe after a client has closed the connection, use
 | 
|---|
| [19] | 103 | Sys2DisconnectNamedPipe.  Finally, the pipe can be destroyed using
 | 
|---|
 | 104 | Sys2Close.
 | 
|---|
| [17] | 105 | 
 | 
|---|
| [16] | 106 | REXX ARGUMENTS:
 | 
|---|
 | 107 |   1. The name of the pipe, in the form "\PIPE\something".  (REQUIRED)
 | 
|---|
 | 108 |   2. The size of the outbound buffer, in bytes.  (REQUIRED)
 | 
|---|
 | 109 |   3. The size of the inbound buffer, in bytes.  (REQUIRED)
 | 
|---|
 | 110 |   4. The pipe's timeout value, in milliseconds.  (DEFAULT: 3000)
 | 
|---|
 | 111 |   5. The number of simultaneous instances of this pipe which are allowed.
 | 
|---|
 | 112 |      Must be between 1 and 254, or 0 indicating no limit.  (DEFAULT: 1)
 | 
|---|
 | 113 |   6. Pipe blocking mode, one of:
 | 
|---|
 | 114 |        W = WAIT mode, read and write block waiting for data  (DEFAULT)
 | 
|---|
 | 115 |        N = NOWAIT mode, read and write return immediately
 | 
|---|
 | 116 |   7. Pipe mode, one of:
 | 
|---|
 | 117 |        I = Inbound pipe  (DEFAULT)
 | 
|---|
 | 118 |        O = Outbound pipe
 | 
|---|
 | 119 |        D = Duplex (inbound/outbound) pipe
 | 
|---|
 | 120 |   8. Privacy/inheritance flag, one of:
 | 
|---|
 | 121 |        0 = The pipe handle is inherited by child processes (DEFAULT)
 | 
|---|
 | 122 |        1 = The pipe handle is private to the current process
 | 
|---|
 | 123 |   9. Write-through flag, one of:
 | 
|---|
 | 124 |        0 = Allow delayed writes (write-behind) to remote pipes (DEFAULT)
 | 
|---|
 | 125 |        1 = Force immediate writes (write-through) to remote pipes
 | 
|---|
 | 126 | 
 | 
|---|
 | 127 | REXX RETURN VALUE:  A four-byte pipe handle.
 | 
|---|
 | 128 | 
 | 
|---|
 | 129 | 
 | 
|---|
 | 130 | -------------------------------------------------------------------------
 | 
|---|
 | 131 | Sys2DisconnectNamedPipe
 | 
|---|
 | 132 | 
 | 
|---|
 | 133 | Unlocks a named pipe after a client has closed its connection.
 | 
|---|
 | 134 | 
 | 
|---|
 | 135 | REXX ARGUMENTS:
 | 
|---|
 | 136 |   1. The pipe handle, as returned by Sys2CreateNamedPipe.      (REQUIRED)
 | 
|---|
 | 137 | 
 | 
|---|
 | 138 | REXX RETURN VALUE:
 | 
|---|
 | 139 |   1 on success, or 0 if an error occurred.
 | 
|---|
 | 140 | 
 | 
|---|
 | 141 | 
 | 
|---|
 | 142 | -------------------------------------------------------------------------
 | 
|---|
| [4] | 143 | Sys2DropFuncs
 | 
|---|
 | 144 | 
 | 
|---|
 | 145 | Deregisters all Sys2* REXX functions.
 | 
|---|
 | 146 | 
 | 
|---|
 | 147 | REXX ARGUMENTS:    None
 | 
|---|
 | 148 | REXX RETURN VALUE: ""
 | 
|---|
 | 149 | 
 | 
|---|
 | 150 | 
 | 
|---|
 | 151 | -------------------------------------------------------------------------
 | 
|---|
| [21] | 152 | Sys2FormatNumber                                                         
 | 
|---|
 | 153 |                                                                          
 | 
|---|
 | 154 | Formats a number to use thousands-grouping characters.  The system values
 | 
|---|
 | 155 | for the current locale are used for the thousands-grouping character and
 | 
|---|
| [22] | 156 | the decimal place, if any.  Note that the IBM C runtime's locale 
 | 
|---|
| [21] | 157 | definitions are used; these may not correspond precisely to the system 
 | 
|---|
 | 158 | locales as defined in the OS/2 Locale object.
 | 
|---|
 | 159 | 
 | 
|---|
 | 160 | The input number may be a positive or negative integer or floating point
 | 
|---|
 | 161 | value.  It must be a simple, non-localized number value; in other words,
 | 
|---|
 | 162 | it must not contain any thousands-grouping characters, and any decimal 
 | 
|---|
 | 163 | point which it contains must be a period (rather than any localized 
 | 
|---|
 | 164 | decimal symbol).
 | 
|---|
 | 165 |                                                                          
 | 
|---|
 | 166 | REXX ARGUMENTS:                                                          
 | 
|---|
 | 167 |   1. Number to be formatted.                                  (REQUIRED) 
 | 
|---|
 | 168 |   2. Number of decimal places to use for floating point values.  
 | 
|---|
 | 169 |      Ignored for integer values.                            (DEFAULT: 2)
 | 
|---|
 | 170 |                                                                          
 | 
|---|
 | 171 | REXX RETURN VALUE: The formatted number, or '' on error.                 
 | 
|---|
 | 172 | 
 | 
|---|
 | 173 | 
 | 
|---|
 | 174 | -------------------------------------------------------------------------
 | 
|---|
| [4] | 175 | Sys2FormatTime
 | 
|---|
 | 176 | 
 | 
|---|
 | 177 | Converts a number of seconds from the epoch (1970-01-01 0:00:00 UTC) into
 | 
|---|
| [22] | 178 | a formatted date and time string. 
 | 
|---|
| [4] | 179 | 
 | 
|---|
 | 180 | REXX ARGUMENTS:
 | 
|---|
 | 181 |   1. Number of seconds (a positive integer) to be converted.  (REQUIRED)
 | 
|---|
 | 182 |      This value cannot be greater than 2,147,483,647.
 | 
|---|
 | 183 |   2. Format type, one of:
 | 
|---|
 | 184 |        D = return in the form 'yyyy-mm-dd hh:mm:ss (w)' where w
 | 
|---|
 | 185 |            represents the weekday (0-6 where 0=Sunday) (DEFAULT)
 | 
|---|
 | 186 |        I = return in ISO8601 combined form 'yyyy-mm-ddThh:mm:ss[Z]'
 | 
|---|
 | 187 |        L = return in the form 'day month year (weekday) time' where month
 | 
|---|
 | 188 |            and weekday are language-dependent abbreviations
 | 
|---|
 | 189 |      Note: With D and I, time is returned in 24-hour format; L may vary.
 | 
|---|
 | 190 |   3. TZ conversion flag (indicates whether to convert to UTC from local
 | 
|---|
 | 191 |      time), one of:
 | 
|---|
 | 192 |        U = return UTC or unconverted time
 | 
|---|
 | 193 |        L = assume the input is in Coordinated Universal Time, and convert
 | 
|---|
 | 194 |            to local time using the current TZ (DEFAULT)
 | 
|---|
 | 195 | 
 | 
|---|
 | 196 | REXX RETURN VALUE: The formatted time string, or "" on error.
 | 
|---|
 | 197 | 
 | 
|---|
 | 198 | 
 | 
|---|
 | 199 | -------------------------------------------------------------------------
 | 
|---|
 | 200 | Sys2GetClipboardText
 | 
|---|
 | 201 | 
 | 
|---|
 | 202 | Retrieves a plain-text string from the clipboard if one is available.
 | 
|---|
 | 203 | 
 | 
|---|
 | 204 | This function requires Presentation Manager to be active, although the
 | 
|---|
 | 205 | REXX program itself need not be running in a PM process.
 | 
|---|
 | 206 | 
 | 
|---|
 | 207 | REXX ARGUMENTS:
 | 
|---|
 | 208 |   None.
 | 
|---|
 | 209 | 
 | 
|---|
 | 210 | REXX RETURN VALUE: The retrieved clipboard string
 | 
|---|
 | 211 | 
 | 
|---|
 | 212 | 
 | 
|---|
 | 213 | -------------------------------------------------------------------------
 | 
|---|
 | 214 | Sys2GetEpochTime
 | 
|---|
 | 215 | 
 | 
|---|
 | 216 | Converts formatted date and time into a number of seconds (UTC) from the
 | 
|---|
 | 217 | epoch (defined as 1970-01-01 0:00:00).  The input time is assumed to
 | 
|---|
 | 218 | refer to the current timezone as defined in the TZ environment variable.
 | 
|---|
 | 219 | 
 | 
|---|
 | 220 | If no parameters are specified, the current system time is used.  If at
 | 
|---|
 | 221 | least one parameter is specified, then any missing parameter is assumed
 | 
|---|
 | 222 | to be its minimum possible value (1 for day or month, 0 for all others).
 | 
|---|
 | 223 | 
 | 
|---|
 | 224 | The time is formatted according to the C runtime's locale support, as
 | 
|---|
 | 225 | configured via the LANG and LC_* environment variables.
 | 
|---|
 | 226 | 
 | 
|---|
| [19] | 227 | NOTE: Any date prior to 1 January 1970, or later than 19 January 2038,
 | 
|---|
 | 228 |       cannot be supported due to the limitations in how the C library
 | 
|---|
 | 229 |       calculates epoch time.  Specifying any date before 1970 will generate
 | 
|---|
 | 230 |       a REXX error.  Any time/date later than 12:14:07 on 19 January 2038
 | 
|---|
 | 231 |       will return the latter value.
 | 
|---|
 | 232 | 
 | 
|---|
| [4] | 233 | REXX ARGUMENTS:
 | 
|---|
 | 234 |   1. The year (1970-2037)
 | 
|---|
| [19] | 235 |      A 2-digit year can be specified, in which case the number will be
 | 
|---|
 | 236 |      added to 1900 if it is 70 or higher, or to 2000 otherwise.
 | 
|---|
 | 237 |      e.g. '20' ==> 2020
 | 
|---|
 | 238 |           '75' ==> 1975
 | 
|---|
 | 239 |      (This is subject to the limitation noted above.)
 | 
|---|
| [4] | 240 |   2. The month (1-12)
 | 
|---|
 | 241 |   3. The day (1-31)
 | 
|---|
 | 242 |   4. Hours (0-23)
 | 
|---|
 | 243 |   5. Minutes (0-59)
 | 
|---|
 | 244 |   6. Seconds (0-61)
 | 
|---|
 | 245 | 
 | 
|---|
 | 246 | REXX RETURN VALUE: The number of seconds since the epoch, or 0 on error.
 | 
|---|
 | 247 | 
 | 
|---|
 | 248 | 
 | 
|---|
 | 249 | -------------------------------------------------------------------------
 | 
|---|
 | 250 | Sys2KillProcess
 | 
|---|
 | 251 | 
 | 
|---|
 | 252 | Terminates the (first) running process with the specified executable name
 | 
|---|
 | 253 | or process-ID.
 | 
|---|
 | 254 | 
 | 
|---|
 | 255 | REXX ARGUMENTS:
 | 
|---|
 | 256 |   1. The process identifier (program name or process ID) (REQUIRED)
 | 
|---|
 | 257 |   2. Flag indicicating the identifier type:
 | 
|---|
 | 258 |        'P': decimal process ID
 | 
|---|
 | 259 |        'H': hexadecimal process ID
 | 
|---|
 | 260 |        'N': executable program name (with or without extension) (DEFAULT)
 | 
|---|
 | 261 | 
 | 
|---|
 | 262 | REXX RETURN VALUE: 1 on success or 0 on failure.
 | 
|---|
 | 263 | 
 | 
|---|
 | 264 | 
 | 
|---|
 | 265 | -------------------------------------------------------------------------
 | 
|---|
 | 266 | Sys2LoadFuncs
 | 
|---|
 | 267 | 
 | 
|---|
 | 268 | Registers all Sys2* REXX functions (except this one, obviously).
 | 
|---|
 | 269 | 
 | 
|---|
 | 270 | REXX ARGUMENTS:    None
 | 
|---|
 | 271 | REXX RETURN VALUE: ""
 | 
|---|
 | 272 | 
 | 
|---|
 | 273 | 
 | 
|---|
 | 274 | -------------------------------------------------------------------------
 | 
|---|
| [16] | 275 | Sys2LocateDLL
 | 
|---|
| [4] | 276 | 
 | 
|---|
| [16] | 277 | Searches for a DLL by name and returns its fully-qualified path.
 | 
|---|
 | 278 | 
 | 
|---|
| [4] | 279 | If a DLL with the given name is currently loaded, that instance of the
 | 
|---|
 | 280 | DLL will be returned.  Otherwise, standard DLL loading rules (according
 | 
|---|
 | 281 | to the current LIBPATH and/or extended LIBPATH configuration) are used to
 | 
|---|
| [16] | 282 | search for a DLL whose module name matches the one specified.
 | 
|---|
| [4] | 283 | 
 | 
|---|
| [16] | 284 | REXX ARGUMENTS:
 | 
|---|
 | 285 |   1. The name of the DLL to search for.  (REQUIRED)
 | 
|---|
| [4] | 286 | 
 | 
|---|
 | 287 | 
 | 
|---|
| [16] | 288 | REXX RETURN VALUE:
 | 
|---|
 | 289 |   The fully-qualified path of the DLL, if found; "" otherwise.
 | 
|---|
 | 290 | 
 | 
|---|
 | 291 | 
 | 
|---|
| [4] | 292 | -------------------------------------------------------------------------
 | 
|---|
| [17] | 293 | Sys2Open
 | 
|---|
| [4] | 294 | 
 | 
|---|
| [17] | 295 | Opens a file or other stream; files larger than 2GB are supported (this
 | 
|---|
 | 296 | function is a wrapper to DosOpenL).  Direct-DASD mode is not supported by
 | 
|---|
 | 297 | this function, nor is setting the initial extended attributes.
 | 
|---|
 | 298 | 
 | 
|---|
 | 299 | REXX ARGUMENTS:
 | 
|---|
 | 300 |   1. Name of file or stream to open.                           (REQUIRED)
 | 
|---|
 | 301 |   2. Open action flags, must be either "O" (open if exists), "R" (replace
 | 
|---|
 | 302 |      if exists), or nothing (fail if exists), optionally followed by "C"
 | 
|---|
 | 303 |      (create if file does not exist).  If "C" is not specified, the
 | 
|---|
 | 304 |      operation will fail if the file does not exist.  Note that a value
 | 
|---|
 | 305 |      of "" alone will therefore fail automatically.        (DEFAULT: "O")
 | 
|---|
 | 306 |      In summary, the possible combinations are:
 | 
|---|
 | 307 |        O = Open only (if file exists, open it; if not, fail)
 | 
|---|
 | 308 |        OC= Open/create (if file exists, open it; if not, create it)
 | 
|---|
 | 309 |        R = Replace only (if file exists, replace it; if not, fail)
 | 
|---|
 | 310 |        RC= Replace/create (if file exists, replace it; if not, create it)
 | 
|---|
 | 311 |        C = Create only (if file exists, fail; if not, create it)
 | 
|---|
 | 312 |        (empty) = No-op (if file exists, fail; if not, fail)
 | 
|---|
 | 313 |   3. Access mode flags, one or both of:                   (DEFAULT: "RW")
 | 
|---|
 | 314 |        R = Open file with read access.
 | 
|---|
 | 315 |        W = Open file with write access.
 | 
|---|
 | 316 |   4. Sharing mode flags, any combination of:               (DEFAULT: "W")
 | 
|---|
 | 317 |        R = Deny read access to other processes
 | 
|---|
 | 318 |        W = Deny write access to other processes
 | 
|---|
 | 319 |   5. Deny legacy DosOpen access, one of:
 | 
|---|
 | 320 |        0 = Allow DosOpen to access the file                     (DEFAULT)
 | 
|---|
 | 321 |        1 = Deny access using the DosOpen API
 | 
|---|
 | 322 |   6. Privacy/inheritance flag, one of:
 | 
|---|
 | 323 |        0 = The file handle is inherited by child processes.     (DEFAULT)
 | 
|---|
 | 324 |        1 = The file handle is private to the current process.
 | 
|---|
 | 325 |   7. Initial file attributes when creating a file:          (DEFAULT: "")
 | 
|---|
 | 326 |        A = Archive attribute set
 | 
|---|
 | 327 |        D = Directory attribute set
 | 
|---|
 | 328 |        S = System attribute set
 | 
|---|
 | 329 |        H = Hidden attribute set
 | 
|---|
 | 330 |        R = Read-only attribute set
 | 
|---|
 | 331 |   8. Initial file size when creating or replacing a file; ignored if
 | 
|---|
 | 332 |      access mode is read-only.                               (DEFAULT: 0)
 | 
|---|
 | 333 |   9. I/O mode flags, any or all of:                         (DEFAULT: "")
 | 
|---|
 | 334 |       T = Write-through mode (default is normal write)
 | 
|---|
 | 335 |       N = No-cache mode (default is to use filesystem cache)
 | 
|---|
 | 336 |       S = Sequential access
 | 
|---|
 | 337 |       R = Random access
 | 
|---|
 | 338 |          * S and R can combine as follows:
 | 
|---|
 | 339 |              Neither: No locality known (default)
 | 
|---|
 | 340 |              S only:  Mainly sequential access
 | 
|---|
 | 341 |              R only:  Mainly random access
 | 
|---|
 | 342 |              Both:    Random/sequential (i.e. random with some locality)
 | 
|---|
 | 343 | 
 | 
|---|
 | 344 | REXX RETURN VALUE:
 | 
|---|
 | 345 |   File handle, or "" in case of error.
 | 
|---|
 | 346 | 
 | 
|---|
 | 347 | 
 | 
|---|
 | 348 | -------------------------------------------------------------------------
 | 
|---|
| [4] | 349 | Sys2PutClipboardText
 | 
|---|
 | 350 | 
 | 
|---|
 | 351 | Writes a string to the clipboard in plain-text format.  Specifying either
 | 
|---|
 | 352 | no value or an empty string in the first argument will simply clear the
 | 
|---|
 | 353 | clipboard of CF_TEXT data.
 | 
|---|
 | 354 | 
 | 
|---|
 | 355 | This function requires Presentation Manager to be active, although the
 | 
|---|
 | 356 | REXX program itself need not be running in a PM process.
 | 
|---|
 | 357 | 
 | 
|---|
 | 358 | REXX ARGUMENTS:
 | 
|---|
 | 359 |   1. String to be written to the clipboard  (DEFAULT: "")
 | 
|---|
 | 360 |   2. Flag indicating whether other clipboard formats should be cleared:
 | 
|---|
 | 361 |        Y = yes, call WinEmptyClipbrd() before writing text  (DEFAULT)
 | 
|---|
 | 362 |        N = no, leave (non-CF_TEXT) clipboard data untouched
 | 
|---|
 | 363 | 
 | 
|---|
 | 364 | REXX RETURN VALUE:  1 on success, 0 on failure
 | 
|---|
 | 365 | 
 | 
|---|
 | 366 | 
 | 
|---|
 | 367 | -------------------------------------------------------------------------
 | 
|---|
 | 368 | Sys2QueryForegroundProcess
 | 
|---|
 | 369 | 
 | 
|---|
| [20] | 370 | Queries the PID of the current foreground process. (Note that this is not
 | 
|---|
 | 371 | necessarily the same as the process which is calling this function, which 
 | 
|---|
 | 372 | could, for example, be running in the background and/or as a child of the
 | 
|---|
 | 373 | foreground process.)
 | 
|---|
| [4] | 374 | 
 | 
|---|
 | 375 | REXX ARGUMENTS: None
 | 
|---|
 | 376 | 
 | 
|---|
 | 377 | REXX RETURN VALUE:
 | 
|---|
 | 378 |   Integer representing the process ID (in decimal), or 0 if an error
 | 
|---|
 | 379 |   occurred.
 | 
|---|
 | 380 | 
 | 
|---|
 | 381 | 
 | 
|---|
 | 382 | -------------------------------------------------------------------------
 | 
|---|
 | 383 | Sys2QueryPhysicalMemory
 | 
|---|
 | 384 | 
 | 
|---|
 | 385 | Queries the amount of physical memory (RAM) installed in the system.
 | 
|---|
 | 386 | 
 | 
|---|
 | 387 | REXX ARGUMENTS: None
 | 
|---|
 | 388 | 
 | 
|---|
 | 389 | REXX RETURN VALUE:
 | 
|---|
 | 390 |   Integer representing the amount of installed memory, in KiB, or 0 if an
 | 
|---|
 | 391 |   error occurred.
 | 
|---|
 | 392 | 
 | 
|---|
 | 393 | 
 | 
|---|
 | 394 | -------------------------------------------------------------------------
 | 
|---|
 | 395 | Sys2QueryProcess
 | 
|---|
 | 396 | 
 | 
|---|
 | 397 | Queries information about the specified process.
 | 
|---|
 | 398 | 
 | 
|---|
| [20] | 399 | Specifying a process ID of 0 will return the information for the 
 | 
|---|
 | 400 | current process (that is, the process calling this function); note that
 | 
|---|
 | 401 | this requires the second parameter to specify that the identifier is in
 | 
|---|
 | 402 | fact a process ID ('P' or 'H') rather than an executable name.
 | 
|---|
 | 403 | 
 | 
|---|
| [4] | 404 | REXX ARGUMENTS:
 | 
|---|
 | 405 |   1. The process identifier (program name or process ID) (REQUIRED)
 | 
|---|
 | 406 |   2. Flag indicicating the identifier type:
 | 
|---|
 | 407 |        'P': decimal process ID
 | 
|---|
 | 408 |        'H': hexadecimal process ID
 | 
|---|
 | 409 |        'N': executable program name (with or without extension) (DEFAULT)
 | 
|---|
 | 410 | 
 | 
|---|
 | 411 | REXX RETURN VALUE:
 | 
|---|
 | 412 |   A string of the format
 | 
|---|
 | 413 |       pid parent-pid process-type priority cpu-time executable-name
 | 
|---|
 | 414 |   "priority" is in hexadecimal notation, all other numbers are decimal.
 | 
|---|
 | 415 |   "" is returned if the process was not found or if an internal error
 | 
|---|
 | 416 |   occurred.
 | 
|---|
 | 417 | 
 | 
|---|
 | 418 | 
 | 
|---|
 | 419 | -------------------------------------------------------------------------
 | 
|---|
 | 420 | Sys2QueryProcessList
 | 
|---|
 | 421 | 
 | 
|---|
 | 422 | Gets a list of running processes.  The results will be returned in a stem
 | 
|---|
| [16] | 423 | variable, where stem.0 contains number of items, and each stem item is a
 | 
|---|
| [4] | 424 | string of the form:
 | 
|---|
 | 425 |     pid parent-pid process-type priority cpu-time executable-name
 | 
|---|
 | 426 | "priority" is in hexadecimal notation, all other numbers are decimal.
 | 
|---|
 | 427 | 
 | 
|---|
 | 428 | Notes:
 | 
|---|
 | 429 |  - "process-type" will be one of:
 | 
|---|
 | 430 |      0 Full screen protect-mode session
 | 
|---|
 | 431 |      1 Requires real mode. Dos emulation.
 | 
|---|
 | 432 |      2 VIO windowable protect-mode session
 | 
|---|
 | 433 |      3 Presentation Manager protect-mode session
 | 
|---|
 | 434 |      4 Detached protect-mode process.
 | 
|---|
 | 435 |  - If "priority" is 0 then the priority class could not be determined.
 | 
|---|
 | 436 |  - If "executable-name" is "--" then the name could not be identified.
 | 
|---|
 | 437 | 
 | 
|---|
 | 438 | REXX ARGUMENTS:
 | 
|---|
 | 439 |   1. The name of the stem in which to return the results  (REQUIRED)
 | 
|---|
 | 440 | 
 | 
|---|
 | 441 | REXX RETURN VALUE: Number of processes found, or "" in case of error.
 | 
|---|
 | 442 | 
 | 
|---|
 | 443 | 
 | 
|---|
 | 444 | -------------------------------------------------------------------------
 | 
|---|
| [16] | 445 | Sys2Read
 | 
|---|
 | 446 | 
 | 
|---|
| [17] | 447 | Read bytes from a previously-opened stream (wrapper to DosRead).
 | 
|---|
| [16] | 448 | 
 | 
|---|
 | 449 | REXX ARGUMENTS:
 | 
|---|
| [17] | 450 |   1. File handle (as returned by Sys2Open or Sys2CreateNamedPipe).
 | 
|---|
 | 451 |      (REQUIRED)
 | 
|---|
| [16] | 452 |   2. Number of bytes to read.  (REQUIRED)
 | 
|---|
 | 453 | 
 | 
|---|
 | 454 | REXX RETURN VALUE:
 | 
|---|
 | 455 |   String containing the bytes read, or "" in case of error.
 | 
|---|
 | 456 | 
 | 
|---|
 | 457 | 
 | 
|---|
 | 458 | -------------------------------------------------------------------------
 | 
|---|
| [4] | 459 | Sys2ReplaceModule
 | 
|---|
 | 460 | 
 | 
|---|
 | 461 | Unlocks and optionally replaces an in-use (locked) DLL or EXE.
 | 
|---|
 | 462 | 
 | 
|---|
 | 463 | REXX ARGUMENTS:
 | 
|---|
 | 464 |   1. The filespec of the module to be replaced.  (REQUIRED)
 | 
|---|
 | 465 |   2. The filespec of the new module to replace it with.  (DEFAULT: none)
 | 
|---|
 | 466 |   3. The filespec of the backup file to be created.  (DEFAULT: none)
 | 
|---|
 | 467 | 
 | 
|---|
 | 468 | REXX RETURN VALUE:
 | 
|---|
 | 469 |   1 on success, or 0 if an error occurred.
 | 
|---|
 | 470 | 
 | 
|---|
 | 471 | 
 | 
|---|
 | 472 | -------------------------------------------------------------------------
 | 
|---|
| [17] | 473 | Sys2Seek
 | 
|---|
 | 474 | 
 | 
|---|
 | 475 | Move the read/write pointer to the specified location in an open
 | 
|---|
 | 476 | file/stream; files larger than 2GB are supported (this function is a
 | 
|---|
 | 477 | wrapper to DosSetFilePtrL).
 | 
|---|
 | 478 | 
 | 
|---|
 | 479 | REXX ARGUMENTS:
 | 
|---|
 | 480 |   1. File handle (returned by Sys2Open).  (REQUIRED)
 | 
|---|
 | 481 |   2. The signed distance in bytes to move.  (REQUIRED)
 | 
|---|
 | 482 |   3. Move method, one of:
 | 
|---|
 | 483 |        B = Beginning of file
 | 
|---|
 | 484 |        C = Current position (DEFAULT)
 | 
|---|
 | 485 |        E = End of file
 | 
|---|
 | 486 | 
 | 
|---|
 | 487 | REXX RETURN VALUE:
 | 
|---|
 | 488 |   The new file position, in bytes.
 | 
|---|
 | 489 | 
 | 
|---|
 | 490 | 
 | 
|---|
 | 491 | -------------------------------------------------------------------------
 | 
|---|
| [25] | 492 | Sys2SyncBuffer                                                           
 | 
|---|
 | 493 | 
 | 
|---|
 | 494 | Used to synchronize buffer read/write transactions (wrapper to 
 | 
|---|
 | 495 | DosResetBuffer)  For external files, writes the buffer to disk. 
 | 
|---|
 | 496 | For named pipes, blocks until the remote client end of the pipe has read 
 | 
|---|
 | 497 | the contents.
 | 
|---|
 | 498 |                                                                          
 | 
|---|
 | 499 | REXX ARGUMENTS:                                                          
 | 
|---|
 | 500 |   1. File handle (as returned by Sys2Open or Sys2CreateNamedPipe).
 | 
|---|
 | 501 |      (REQUIRED)
 | 
|---|
 | 502 |                                                                          
 | 
|---|
 | 503 | REXX RETURN VALUE:  1 on success, 0 on failure
 | 
|---|
 | 504 | 
 | 
|---|
 | 505 | -------------------------------------------------------------------------
 | 
|---|
| [4] | 506 | Sys2Version
 | 
|---|
 | 507 | 
 | 
|---|
 | 508 | Returns the current library version.
 | 
|---|
 | 509 | 
 | 
|---|
 | 510 | REXX ARGUMENTS:    None
 | 
|---|
 | 511 | REXX RETURN VALUE: Current version in the form "major.minor.refresh"
 | 
|---|
 | 512 | 
 | 
|---|
| [17] | 513 | 
 | 
|---|
 | 514 | -------------------------------------------------------------------------
 | 
|---|
 | 515 | Sys2Write
 | 
|---|
 | 516 | 
 | 
|---|
 | 517 | Write bytes to a previously-opened stream (wrapper to DosWrite).
 | 
|---|
 | 518 | 
 | 
|---|
 | 519 | REXX ARGUMENTS:
 | 
|---|
 | 520 |   1. File handle (as returned by Sys2Open or Sys2CreateNamedPipe).
 | 
|---|
 | 521 |      (REQUIRED)
 | 
|---|
 | 522 |   2. Data to be written.  (REQUIRED)
 | 
|---|
 | 523 | 
 | 
|---|
 | 524 | REXX RETURN VALUE:
 | 
|---|
 | 525 |   The number of bytes successfully written.
 | 
|---|
 | 526 | 
 | 
|---|