OS-ERROR function
- Last Updated: July 23, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Returns, as an INTEGER value, an ABL error code that indicates whether an execution error occurred during the last OS-APPEND, OS-COPY, OS-CREATE-DIR, OS-DELETE, OS-RENAME or SAVE CACHE statement.
Syntax
|
Example
The following procedure prompts the user to enter a file to delete, attempts to delete the file, and then calls the OS-ERROR function to check for an execution error. If an error occurs, the procedure branches based on the error number and responds accordingly.
r-os-err.p
|
Notes
- This function returns 0 if no error occurred.
- Use this function immediately following an OS-APPEND, OS-COPY, OS-CREATE-DIR, OS-DELETE, OS-RENAME, or SAVE CACHE statement to determine whether an error occurred during the statement's execution. If you do not, the next use of one of these statements overwrites the previous error code.
- The following table lists the ABL error codes that the OS-ERROR function can
return.
Table 1. ABL OS-ERROR codes Error number Description 0 No error 1 Not owner 2 No such file or directory 3 Interrupted system call 4 I/O error 5 Bad file number 6 No more processes 7 Not enough core memory 8 Permission denied 9 Bad address 10 File exists 11 No such device 12 Not a directory 13 Is a directory 14 File table overflow 15 Too many open files 16 File too large 17 No space left on device 18 Directory not empty 999 Unmapped error (ABL default)
See also
OS-APPEND statement, OS-COMMAND statement, OS-COPY statement, OS-CREATE-DIR statement, OS-DELETE statement, OS-RENAME statement, SAVE CACHE statement