IOException error on Mac

Dear Forum,

I read text and image files in my app using GetFolderItem and TextInputStream. I built the app for PC and Mac. PC version works great but Mac version only works on some Mac computers. Other Macs show the following errors.

“An exception of class IOException was not handled. The application must shut down”

First I thought this has something to do with OS version (e.g., only works on the latest version, High Sierra) but there’s no pattern at all. It works fine on my High Sierra but does not work on other High Sierra machines. This was the reason why I wanted to include all the files into the project and directly read them (which was the question I posted a while ago).

Can anyone shed me some light?

Here’s part of the code.

[code]Dim f As FolderItem
Dim t As TextInputStream

f=GetFolderItem(Str(get_age_group)+get_height+get_weight+".csv")
t=TextInputStream.Open(f)
[/code]

You should be checking if f is Nil and that f.exists = True before trying to open it.

I suggest putting that filename into a string and using the debugger to show it to you.

a) You should have some graceful way to handle errors.

b) Is your app affected by “app translocation”? Check the forum for this topic. It would explain why only some computers are affected and not all.