Resources folder

I assume it’s a no-no to try and write to an App’s “Resources” folder from the same App on MacOS?

definitely a no no

Thank you for confirming that. Unfortunately, it doesn’t care when it’s on my own machine. Builds worked fine for me, but not for builds sent to other customers. Still learning my way around MacOS.

Sadly, when it fails it comes up with NO error message. Error.message is blank on a Try/Catch.

Why are you writing to the Resources folder? You should be using SpecialFolder.ApplicationData, which on Mac would be in the Application Support folder where all other applications keep their user data.

And it doesn’t matter if its “the same app”… if you write into the Resource folder you disrupt the CRC of the bundle and it is no longer valid.

1 Like

You might only get a permission denied error code

Why? Because I know very little about MacOS. I learn by fucking up. :slight_smile:

2 Likes

Weirdly, no error message at all.

Doesn’t matter if it’s Mac, Windows or Linux. SpecialFolder.ApplicationData gives you the proper place to write to on all desktop platforms. Check out all the other SpecialFolder locations in the docs. Xojo falters in some cross-platform areas, but this is not one of them.

1 Like

This one I’m not sure what, if anything, the OS actually would report to Xojo
So I dont know if its Xojo not passing along the OS message
Or if it literally just doesnt get one
Or what

Welcome to the world of being a Mac developer. For some things there is documentation, for the other figure it out yourself…

2 Likes

I’lve fixed that for ya @samRowlands
Welcome to the world of being a developer.
For some things there is documentation, for the other figure it out yourself…
Just dont ask on stack overflow as they’ll eat you alive if you’re a newbie

3 Likes

lol…

In this case, there is data in the documentation: just read SpecialFolder and you will get where on the target platform the folders are (just read and forget this paragraph).

On many things, the programming is similar / Xojo do the things for each platform: you do not really have to know the target, just read the docs.

Unfortunately, as others wrote earlier, sometimes things are from similar to frankly different.

Human Interface Guidelines (an Apple original document that was many years ago published by Addison Wesley), available on line for free on all three OS platforms will give you ideas on what is usual for its platform.

Also, when I do not have an idea on a subject, I take a look at OS shared applications (TextEdit for macOS is an example).

The Resources folder is a Xojo thing (as far as I recall); I never saw that on macOS previously (prior Xojo / Real Studio / REALbasic).

The RESOURCE folder is NOT an “Xojo Thing”… it is a folder that is most defintiely defined by APPLE (for macOS, iOS and AppleTV)… that is not to say that Apple didn’t define until the time frame you saw it. but Xojo DID NOT make this up

TextEdit most certainly has a “Resources” folder… and I’m thinking this structure started with OS X, and wasn’t in OS9

In Classic MacOS resources were in the resource fork of an application
Since Apple deprecated the use of those they had to go somewhere and “Bundles” were the answer
They’re a NeXTStep thing as far as I know as way way back when for next step you could compile really fat apps that worked on several OSes as one distributable package

The Resources folder has excited since macOS 10.0 as it’s an essential part of an application bundle, it’s the One and only place where you should store non-executable code safely.

Edit.

That folder is hidden in TextEdit application: it is not displayed to the user.

Apple and Oranges…

Sam: sorry, I read your post after I sent this one. But, as you can read, I know.

Because I nearly never see the Resources folder on macOS, I recall it from Windows as a visible (by the user) folder just like the dll folders…

No macOS app exposes that Folder to the user, the User should never know (or care) that it exists. Beyond activities that occur during developement, the RESOURCE folder should be considered READONLY .