Cannot save a file with a slash in the title

Discussion forum for Amadeus users

Moderator: Martin Hairer

Post Reply
jasonfist
Posts: 11
Joined: Tue Jul 26, 2011 1:38 pm

Cannot save a file with a slash in the title

Post by jasonfist »

Using a slash in the title of a saved file results in an error.

The workaround is to save without the slash and change the file name in the Finder afterwards, but if the Finder supports names with a slash, I'm not quite sure why Amadeus can't just save them itself.

User avatar
Martin Hairer
Site Admin
Posts: 1975
Joined: Wed Nov 08, 2006 11:49 am
Contact:

Cannot save a file with a slash in the title

Post by Martin Hairer »

If the Finder supports names with a slash, I'm not quite sure why Amadeus can't just save them itself.
The support of slashes in filenames is a bit of a hack that Apple has been changing silently with every new major OS release, thus breaking most existing apps in the process.

The latest version of Amadeus Pro (2.0.4) should work fine in that regard, at least on OS 10.7 (but I think also on 10.6). Regards,

Martin

--
HairerSoft
http://www.hairersoft.com/




_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

User avatar
Martin Hairer
Site Admin
Posts: 1975
Joined: Wed Nov 08, 2006 11:49 am
Contact:

Cannot save a file with a slash in the title

Post by Martin Hairer »

Just for those of you who are wondering: the reason why it is a hack is that Unix (and related) filesystems do not allow slashes in filenames, since this is the way directories are separated from subdirectories. However, for historical reasons (going back to the very early days of the Mac, way before Mac OS X), filenames on the Mac do allow slashes and it is the semicolon that plays the role of the forbidden character instead. (Try using the Finder to rename a file with a semicolon in the name…)

As a consequence, Mac OS internally stores filenames with semicolons (and this is what you see when you list a directory in the Terminal), but displays them as slashes in the Finder in order to be backwards-compatible to Methuselah.

So far, so good, but you can imagine that problems can arise because of this discrepancy: for all the Unix stuff, functions should return filenames without slashes, otherwise zillions of lines of code would break. For all the "Mac" stuff, functions should return filenames without semicolons, or another zillion of lines of code would break. In general, Apple has been pretty good at keeping the two separate, but there is one particular function call whose behaviour changed between 10.5 and 10.6. Apparently, this was unintentional and Apple treated it as a bug, but it took them until Mac OS 10.7 to revert the behaviour. In the meantime, I had circumvented the bug, so that the reversal to the "correct" behaviour caused AP to misbehave… Regards,

Martin

--
HairerSoft
http://www.hairersoft.com/




_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

CDJonah_alt
Posts: 379
Joined: Thu Mar 15, 2007 3:57 pm

Cannot save a file with a slash in the title

Post by CDJonah_alt »

Bottom line -- avoid slashes and semicolons in file names -- why ask for trouble.

Chuck

On 9/27/11 3:17 PM, Martin Hairer wrote:
Just for those of you who are wondering: the reason why it is a hack is that Unix (and related) filesystems do not allow slashes in filenames, since this is the way directories are separated from subdirectories. However, for historical reasons (going back to the very early days of the Mac, way before Mac OS X), filenames on the Mac do allow slashes and it is the semicolon that plays the role of the forbidden character instead. (Try using the Finder to rename a file with a semicolon in the name…)

As a consequence, Mac OS internally stores filenames with semicolons (and this is what you see when you list a directory in the Terminal), but displays them as slashes in the Finder in order to be backwards-compatible to Methuselah.

So far, so good, but you can imagine that problems can arise because of this discrepancy: for all the Unix stuff, functions should return filenames without slashes, otherwise zillions of lines of code would break. For all the "Mac" stuff, functions should return filenames without semicolons, or another zillion of lines of code would break. In general, Apple has been pretty good at keeping the two separate, but there is one particular function call whose behaviour changed between 10.5 and 10.6. Apparently, this was unintentional and Apple treated it as a bug, but it took them until Mac OS 10.7 to revert the behaviour. In the meantime, I had circumvented the bug, so that the reversal to the "correct" behaviour caused AP to misbehave… Regards,

Martin

--
HairerSoft
http://www.hairersoft.com/



_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

philxm
Posts: 128
Joined: Sun Nov 12, 2006 6:55 pm

Cannot save a file with a slash in the title

Post by philxm »

I believe you mean colon [:], which is illegal in Mac filneames, rather than
semicolon [;], which is (and always has been) legal.

Also, Photoshop, for one, automatically swaps a hyphen [-] for a slash [/]
(which is more correctly called "virgule") when it encounters one in a
filename. This is a much friendlier behavior than the Finder's abrupt
rejection of any attempt to confirm an illegal filename, and return only of
an error message that doesn't even bother to identify the specific problem.

--Phil M.


Martin Hairer wrote:
Just for those of you who are wondering: the reason why it is a hack is that
Unix (and related) filesystems do not allow slashes in filenames, since this
is the way directories are separated from subdirectories. However, for
historical reasons (going back to the very early days of the Mac, way before
Mac OS X), filenames on the Mac do allow slashes and it is the semicolon that
plays the role of the forbidden character instead. (Try using the Finder to
rename a file with a semicolon in the nameŠ)

As a consequence, Mac OS internally stores filenames with semicolons (and this
is what you see when you list a directory in the Terminal), but displays them
as slashes in the Finder in order to be backwards-compatible to Methuselah.

So far, so good, but you can imagine that problems can arise because of this
discrepancy: for all the Unix stuff, functions should return filenames without
slashes, otherwise zillions of lines of code would break. For all the "Mac"
stuff, functions should return filenames without semicolons, or another
zillion of lines of code would break. In general, Apple has been pretty good
at keeping the two separate, but there is one particular function call whose
behaviour changed between 10.5 and 10.6. Apparently, this was unintentional
and Apple treated it as a bug, but it took them until Mac OS 10.7 to revert
the behaviour. In the meantime, I had circumvented the bug, so that the
reversal to the "correct" behaviour caused AP to misbehaveŠ Regards,

Martin

--
HairerSoft
http://www.hairersoft.com/



_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at
http://two.pairlist.net/mailman/listinfo/forum_list
_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

User avatar
Martin Hairer
Site Admin
Posts: 1975
Joined: Wed Nov 08, 2006 11:49 am
Contact:

Cannot save a file with a slash in the title

Post by Martin Hairer »

I believe you mean colon [:], which is illegal in Mac filneames, rather than
semicolon [;], which is (and always has been) legal.
Yes, sorry. English isn't my first language and for some reason I always mix them up…

Martin

--
HairerSoft
http://www.hairersoft.com/




_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

User avatar
Martin Hairer
Site Admin
Posts: 1975
Joined: Wed Nov 08, 2006 11:49 am
Contact:

Generating playlists

Post by Martin Hairer »

I tried Export Markers but got too much information.
It shouldn't be too hard to get TextWrangler to trim that down.
Regards,

Martin

--
HairerSoft
http://www.hairersoft.com/




_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

jasonfist
Posts: 11
Joined: Tue Jul 26, 2011 1:38 pm

Post by jasonfist »

Interesting conversation, but for me it all boils down to this:

- OSX allows file names with slashes
- Amadeus Pro accepts file names with slashes, starts the saving process, but only at the end says that the file was unable to be saved.

It's not very logical behaviour.

For the moment, I am having to replace the slash with an underscore when saving (so it will work), then go to the Finder and replace the underscore with a slash in the filename. It's slightly silly.

This behaviour is still present in the latest Amadeau Pro and the latest version of OS X (10.7.3).

Will there ever be a fix? Surely a program should be able to save a file containing characters that are all permitted by the system?

CDJonah_alt
Posts: 379
Joined: Thu Mar 15, 2007 3:57 pm

Cannot save a file with a slash in the title

Post by CDJonah_alt »

Actually, no, the file system does not allow file names with slashes. It
encodes file names with slashes to remove/hide the slashes. I suspect
the finder allows slashes for legacy reasons.

Chuck

On 3/8/12 2:53 AM, jasonfist wrote:
Interesting conversation, but for me it all boils down to this:

- OSX allows file names with slashes
- Amadeus Pro accepts file names with slashes, starts the saving process, but only at the end says that the file was unable to be saved.

It's not very logical behaviour.

For the moment, I am having to replace the slash with an underscore when saving (so it will work), then go to the Finder and replace the underscore with a slash in the filename. It's slightly silly.

This behaviour is still present in the latest Amadeau Pro and the latest version of OS X (10.7.3).

Will there ever be a fix? Surely a program should be able to save a file containing characters that are all permitted by the system?




_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list
_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

jasonfist
Posts: 11
Joined: Tue Jul 26, 2011 1:38 pm

Re: Cannot save a file with a slash in the title

Post by jasonfist »

Actually, no, the file system does not allow file names with slashes. It encodes file names with slashes to remove/hide the slashes. I suspect the finder allows slashes for legacy reasons.

Chuck
Apart from you being rather pedantic, what the back end does in this case, and for what reason, is pretty much irrelevant.

As things stand, if I can name a file in the Finder using a slash in the title (which I can), I should be able to save a file with a slash in the title from Amadeus (which I can't).
Last edited by jasonfist on Thu Mar 08, 2012 2:56 pm, edited 1 time in total.

CDJonah_alt
Posts: 379
Joined: Thu Mar 15, 2007 3:57 pm

Cannot save a file with a slash in the title

Post by CDJonah_alt »

Actually not -- almost certainly Apple provides the API that is used to
save file so they don't want you to put slashes in file names. If you
want to do it, remember they may stop supporting it in future versions
and you will be subject to any bugs that show up in the translation process.

Chuck

On 3/8/12 8:38 AM, jasonfist wrote:
CDJonah_alt wrote:Actually, no, the file system does not allow file names with slashes. It encodes file names with slashes to remove/hide the slashes. I suspect the finder allows slashes for legacy reasons.

Chuck

Apart from you being rather pedantic, what the back end does in this case, and for what reason, is pretty much irrelevant.

As things stand, if I can name a file in the Finder using a slash in the title (which I can), I should be able to save a file with a slash in the title from Amadeus (which I can't).




_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list
_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

jasonfist
Posts: 11
Joined: Tue Jul 26, 2011 1:38 pm

Re: Cannot save a file with a slash in the title

Post by jasonfist »

Actually not -- almost certainly Apple provides the API that is used to save file so they don't want you to put slashes in file names. If you want to do it, remember they may stop supporting it in future versions and you will be subject to any bugs that show up in the translation process.

Chuck
Quite possibly, and Martin has always found successful workarounds in the past. It would be great if he could this time too.

For info, TextEdit (from Apple) allows you to save no problem using file names containing a slash, so maybe it isn't just an API problem.

And as I said, when Amadeus starts saving, it only informs you at the end of the process that something's up. It's just frustrating when I forget about the problem.

User avatar
Martin Hairer
Site Admin
Posts: 1975
Joined: Wed Nov 08, 2006 11:49 am
Contact:

Cannot save a file with a slash in the title

Post by Martin Hairer »

This behaviour is still present in the latest Amadeau Pro and the latest version of OS X (10.7.3).
I just tried it and it works fine for me. Could I have precise step by step instructions on how to reproduce this reliably with the latest versions of Amadeus Pro and OS X?
Will there ever be a fix?
As mentioned earlier, Apple has a history of breaking this behaviour between OS releases so any "fix" only works as long as they don't break it yet again by switching behaviour. I have unfortunately no crystal ball allowing me to predict when Apple will decide to break the behaviour of a poorly documented API. Regards,

Martin

--
HairerSoft
http://www.hairersoft.com/



_______________________________________________
Amadeus forum mailing list
Unsubscribe / change settings at http://two.pairlist.net/mailman/listinfo/forum_list

Post Reply