From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Class (inherits from RuntimeException)

Raised when an IO error occurs using BinaryStream, TextOutputStream, or TextInputStream.

ErrorNumber Message
Stack StackFrames


The IOException represents errors that can occur while using the shared methods for opening and creating streams: BinaryStream.Open, BinaryStream.Create, TextOutputStream.Create, TextOutputStream.Append, and TextInputStream.Open. If you are using older APIs, you need to check the FolderItem.LastErrorCode property.

Error Codes

The ErrorNumber property of an IOException may be set to an OS error code.


The OS Status web site can help track down error code meanings.

In addition you can check the older Mac OS System Error Codes, which are can still be useful since LastErrorCode uses older Carbon error codes.


Windows error codes are available at MSDN.


Linux error codes are defined in a header file, errno.h.

Sample Code

The following example catches an IOException if it occurs.

Var f As FolderItem = FolderItem.ShowSaveFileDialog(FileTypes1.Text, "Create Example.txt")
If f <> Nil Then
Var t As TextOutputStream = TextOutputStream.Create(f) // this line could raise an IOException.
End If

Exception err As IOException
MessageBox("An error occurred while attempting to create/save the file.")

See Also

BinaryStream, RuntimeException, TextInputStream, TextOutputStream classes.