Xojo.IO.TextInputStream: Can not open file

I have an issue with working code in the “classic” framework which doesn’t work when translated to the new framework:

[code]Using Xojo.Core
Using Xojo.IO

Dim sh As New Shell()

sh.Execute "mktemp " + SpecialFolder.Temporary.Path + “/temp.XXXXXX”
Dim result As Text = sh.ReadAll.ToText

Dim fi As FolderItem = New FolderItem(result)
sh.Execute(… + " > " + fi.Path) // Fill fi with data from some OS X command
sh.Close()

Break // The file is now created on disk and the content can be read with TextEdit.app

Dim tis As TextInputStream = TextInputStream.Open(fi, TextEncoding.UTF8) // Xojo.IO.IOException raised[/code]
The error message of the IOException is This file could not be opened (error number is 0 and underlying error is Nil).