unixerror - handle UNIX run-time error




Unixerror maps the UNIX error number errno (see intro(2)) into the most appropriate BASIC error number as follows:

                  UNIX Error            BASIC Error
  1Not owner  5Illegal function call
  2No such file or directory53File not found
  5I/O Error72Disk Media Error
  6No such device or address71Disk not Ready
12Not enough space  7Out of memory
13Permission denied  5Illegal function call
17File exists58File already exists
21Is a directory64Bad file name
28No space left on device61Disk full
30Read-only file system70Disk Write Protect
33Math argument11Division by zero
34Result too large  6Overflow

All other UNIX errors are mapped into BASIC Error 51: “Internal Error.”

Unixerror then passes the BASIC error number to runerr(err). 

This function is called by many routines in the library when an error is detected by a UNIX system call. 


intro(2) in the UNIX Programmer’s Manual

from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber