IOException on TextInputStream

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?

Use FolderItem.PathTypeNative.

It’s also a good idea to check

If f <> Nil and f.exists Then

[quote=146287:@Roger Clary]It’s also a good idea to check

If f <> Nil and f.exists Then

Better

if f <> nil then if f.exists then

If you check exists and f is nil, you get an exception.

[quote=146289:@Michel Bujardet]Better

If f <> Nil and f.exists Then

If you check exists and f is nil, you get an exception.[/quote]
Wrong.
f.exists will be only calculated if f<>nil.
So that code is valid and short.

[quote=146296:@Thomas Eckert]Wrong.
f.exists will be only calculated if f<>nil.
So that code is valid and short.[/quote]

You are right.