ADC Home > Reference Library > Technical Q&As > Graphics & Imaging > ColorSync >
|
Q:
I'm using ColorSync routines to create and write profiles.
On Mac OS 10.2, if I pass a file name with a '/' character
in it to These errors seem to indicate the file name is being interpreted differently, as if the '/' characters are being seen as pathname delimiters instead of part of the file name. What's going on? A:
When using 1) The path must start with '/' 2) Directories are delimited with '/' 3) Names that appear to contain a '/' should instead have a ':' in the path POSIX file names with the ':' character will look different in the Finder and with the Carbon APIs. For example, a POSIX file "/Library/foo:bar" would appear as "<boot drive name>:Library:foo/bar" in the Finder and in the Carbon APIs. 4) Names that contain high-ASCII or Unicode characters should be UTF8-encoded As an example, if your application prompts the user for a profile name to use when placing a profile in /Library/ColorSync/Profiles/ you should: 1) Get the string from the user 2) Convert from the current encoding to UTF8-encoding 3) Convert '/' characters to ':' and vice-versa 4) Append the string to "/Library/ColorSync/Profiles/" As to why the behavior changed slightly in Mac OS 10.2: 1) Pre-Mac OS 10.2, ColorSync internally used 2) For slightly better performance on Mac OS 10.2, ColorSync
internally uses POSIX-based file I/O. Most likely the pre-Mac OS 10.2 path-to-spec conversion was a bit too forgiving. Paths that work on Mac OS 10.2 should work on earlier releases. [Nov 06 2002] |
|