Application.BundleResourceFolderMBS gives 2 wrong results

Hello,

I’m trying to use the BundleResourceFolderMBS method of the application class, which fails (folderitem doesn’t exist) in these cases:
1: when my app runs from a NAS. The native path shows the path going by the virtually mounted folder (the share is mounted using the unix_mount command). Looks like the folderitem doesn’t like that path.
2: so I tried putting the debug app right on the desktop; this is the native path: /Users/me/Desktop/Contents/Resources
The app name is missing in the path (obviously, folderitem.exists returns false).

I can work-around this, just wanted to tell about this and wondered it’s a known bug.
Using latest Xojo version, latest plugins and Mac 10.14.x.

Why aren’t you using SpecialFolder.Resources?

1 Like

If you haven’t done so already, report this to Christian as it appears to be a fault in the plugin. Does your application name contain non-ascii characters?

I was using the MBS method since when SpecialFolder.Resources didn’t exist. As I don’t necessarily rewrite my code for every new change, I kept this method for the time being.
Now that I see the MBS call doesn’t work in my cases, I’m indeed using the SpecialFolder method.
Thanks.

That’s why I’ve posted this in the forum :wink:

No, plain ASCII characters, even no space. Same about the path.
I suspect the problem comes from the fact there’s the mount point (/volumes/Users), the afp path (afp://username@server) and the folder-to-mount point (not sure how this called, as I don’t even quite understand why it’s required by the mount command; /users/me/NAS1/Users/).

Thanks.

For API 1.0 and IDEs without SpecialFolder.Resources I’ve got an open source module that has a bunch of handy locations :slight_smile:

2 Likes

Nice, thank you.

The plugin is using OS functions. You could do the same with a declare.
I may check if I can reproduce it later.

Either macOS doesn’t report the right path or the plugin doesn’t build the folder item correctly.

And since Xojo has this built-in, I may just deprecate it.

I just ran into this same bug. No idea when this broke, but the MBS function doesn’t return the right path, and it’s the same error reported here, that the name of the application is missing from the path, so this has nothing to do with your NAS, it’s just totally a broken function. Luckily this is easy to replace since SpecialFolder.Resources now exists and works fine.

1 Like

I think we fixed a bug there, so it may work now with 21.4pr

1 Like
Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.