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