FileIO Errors

When you instantiate either the FileIO Xtra or XObject on either Macintosh or Windows, the return value is either a successful instance or an integer error code. Refer to Chapter 14.

The older FileIO XObject and Xtra on both platforms return the same values, with exceptions noted in the text that follows. Other FileIO methods, such as writeChar and readChar, also return either success (0) or some negative error code.

Table E-3 shows the strings returned by FileIO’s error() method for a given integer error code as returned by the status() method (column 1), such as:

set fileInstance = new (xtra "FileIO")
openFile (fileInstance, fileName, mode)
set errorCode = status(fileInstance)
put error (fileInstance, errorCode)

Similar values are returned by the mStatus() and mError() methods of the FileIO XObject. Some error codes shown are not translated by either the Xtra or XObject, but appear occasionally and can be interpreted using MacErrors instead. These descriptions and their likely cause are shown in parentheses.

Table E-3. FileIO Xtra and XObject Errors

Code

Xtra

XObject

Meaning

1

 

“Memory allocation failure”

0

 

“OK” (Mac and Windows Xtra) (Sucess)

0

 

“OK” (Mac FileIO XObject) (Sucess)

0

 

EMPTY (Windows FileIO XObject) (Sucess)

−1

 

“Unknown Error” (attempted to use readChar when already at the end of the file)

−1

 

EMPTY (Mac FileIO XObject)

−33

“File directory full” (too many files in directory)

−34

“Volume full” (disk is full) ...

Get Lingo in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.