I receive an IOException if I try to read a file with TextInputStream:
f = GetFolderItem(path, FolderItem.PathTypeAbsolute)
If f <> Nil Then
Try
stream = TextInputStream.Open(f) // <---- This is where the IOException occurs
content = stream.ReadAll()
Catch
MsgBox("Error accessing file.")
Finally
If stream <> Nil Then
stream.Close
End If
End Try
End If
path = Absolute path to a text file on my desktop ( /Users/Airwaver/Desktop/package.json )
Error number = 2
Error message = empty
My Environment:
Mac OS X 10.10
Xojo 2014 Release 2.1
What is wrong with my code?