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







“Memory allocation failure”



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



“OK” (Mac FileIO XObject) (Sucess)



EMPTY (Windows FileIO XObject) (Sucess)



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



EMPTY (Mac FileIO XObject)


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


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

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.