Why does saving a project overwrite the finder label?

When saving complex projects in “Xojo Project” format, it’s often invaluable to highlight the “xojo_project” file so that it can be found easily in the finder. The problem is that the Xojo IDE overwrites any label changes to the file each time the project is saved. This is not the case with almost any other application that I have tried (try editing and saving a file in TextEdit for instance, the finder labels, comments, etc. are all retained).

Is this a bug? I can start a feedback case, but I’d like to get opinions before I do so…

Cheers.

-bill k

It is worse on a certain unreleased Mac version. What is happening is the file gets replaced on save, thus nuking the Finder metadata.

If I edit a xojo file using TextWrangler this doesn’t happen. Even in the unreleased version of Mac OS which shall not be named…

So this is a bug? I’ll open a feedback case if it is.

TextWrangler is probably using an OS API to replace the file contents. This is an area where I’m not an expert. But in the unreleased OS, the tags get nuked on save. I have a case for this already, but it is private given the OS in question.

Anyway, yes I would consider it a bug.

So it’s happening in any version of Mac OS.

<https://xojo.com/issue/29227>

I would guess it is because when you save a file with Xojo… it creates a temp file first.

a) Save temp.file
b) delete original file (oops… there went the metadata)
c) rename temp.file to original file name

you can even watch this happening if you have finder open to the correct directory when you save your project.

we use OS API’s to swap it “safely”
BUt that’s likely what drops the meta data as the swap may not retain it

[quote=30302:@Norman Palardy]we use OS API’s to swap it “safely”
BUt that’s likely what drops the meta data as the swap may not retain it[/quote]
Yeah I remember you doing something like that. Which is why it surprised me to see the metadata not being preserved.

Not sure to be honest
It could be the particular API we’re using as there is often more than one (as you know)
The report will get looked at & we’ll see whats up.

The old IDE used FSExchangeObjects for that, but the Xojo IDE doesn’t use that function any more (I’m telling by checking the IDE execuable with the “nm” terminal cmd).

But why was it removed?

Because Apple now deprecates it? That doesn’t mean it’s not usable any more, though. It’s just that Apple discourages the old APIs from being used in new code because they’re a bit inefficient compared to the NSURL API. Maybe bring it back? Or does NSURL offer a similar function?

[quote=30284:@William Koperwhats]So it’s happening in any version of Mac OS.

<https://xojo.com/issue/29227>[/quote]

You make a point that I’ve made numerous times in the past as well: That the way the VCP project is mixed up with all the other files is rather, uh, not smart. I criticized this the first time the vcp format was introduced, suggesting to put all the other files into a folder, but that seemed never getting considered. That’s why I keep shaking my head at decisions the RS dev team makes, for many years (I mean, who with a few years of programming experience and tools usage could not see that this is not smart? Even other tools like Xcode, which I’m sure they’re using, too, is hiding the other files inside a folder. It’s the smart thing to do, isn’t it? Sorry, I digress again.)

I have also made another, simpler to fix suggestion that should not even hold up the super-busy dev team because it can be done by a non-programmer: <https://xojo.com/issue/28367> I.e, just make the icon stand out! That be coming close to your work-around with the custom labelling, and would even help on Win + Linux. Feel free to add your vote to it :wink:

Hm… there is already an older request: <https://xojo.com/issue/4328> “Different Icons for VCP Project items”.

Don’t expect such a rocket technology feature to be implemented any time soon.

BTW: I use a label for the project file, too.

I just noticed that this case is private (I don’t know why). It was filed on 19.09.2008.

I just found a trick to get the “unique icon” feature enabled :slight_smile:

Use a tool or write your own to remove the Creator and Filetype codes from every file of the project. Then all but the main xojo_project file get generic white icons. Sadly, this works only until the next save, though.

Another trick is to put all your items into a folder in your project. Makes navigating our project harder, though.

My trick for VCP organization is to create a project folder (MyProject) and within that create a Source folder. The project is saved within the Source folder, then I create an alias to the project file in the MyProject folder. This also gives me an obvious place to put additional organization, such as an Assets folder for PSD files and whatnot. So my organization may look like

MyProject Assets MyProject.xojo_project (Alias to Source/MyProject.xojo_project) Source MyProject.xojo_project (other vcp files)

I wonder why even the Xojo team has to perform tricks instead of solving the issue so that no “trick” is needed at all.

It’s a personal trick. And besides, do you have a suggestion so that no trick is needed at all? Xojo has a responsibility to create a structure that is platform agnostic. My trick works on any one platform, but not on all three. Aliases are platform specific, so that would be a problem.

Well, I don’t really care about “all Platforms” but the suggested visually different project icon would be very helpful and I guess that it is a simple task. And I guess it should work at least on Mac and Windows.