O'Reilly logo

Lingo in a Nutshell by Bruce A. Epstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required