I just want to make sure that I’m not losing my mind here, but this line of code should throw an UnsupportedFormatException right?
dim f as new FolderItem("/this/path/doesnt/exist", FolderItem.PathModes.Native)
In the past, something like this used to work:
dim validPath as boolean
Try
dim f as new FolderItem("/some/path/variable", FolderItem.PathModes.Native)
validPath = true
Catch e as UnsupportedFormatException
validPath = false
End
According to the documentation:
If Path cannot be resolved to a FolderItem, an UnsupportedFormatException is raised. This is notably the case when a folder does not exist within the given Path or when you do not have the correct access permissions for something in the path. Only the last component of the path is allowed not to exist.
This is on Xojo 2026 R1.2 and macOS 26.4.1
I know I can check the Exists property on the FolderItem, but this seems like a regression that could break existing code.
Just wanted to check with others before opening a ticket.
If in "/some/path/somefileorfolder", the "/some/path/" exists, but somefileorfolder don’t, it never will raise an exception, you know that, correct? It raises when the parent of the final part does not exist too.
Right, that’s how it’s supposed to work, but it seems like it never throws an exception now even if the start of the path doesn’t exist.
The behavior seems incompatible with the docs
What does that folderitem look like in the debugger? Does it exist? What is its path?
This is the code that I’m using to test here:
dim f as FolderItem
f = new FolderItem("/this/path/doesnt/exist", FolderItem.PathModes.Native)
f.CreateAsFolder
dim stream as BinaryStream
stream = BinaryStream.Create(f, true)
stream.Write("this is a test")
stream.Close
The variable f looks like this and no exception is thrown:
This line f.CreateAsFolder also doesn’t throw an exception.
This line stream = BinaryStream.Create(f, true) does throw an exception as it should:
However, there is no message in the exception:
And just as a curiosity, here is the Parent of f:
And just as a second sanity check. Here is a path search in Find Any File: