This is not the answer you are looking for.
But you can play with this conversion in Applescript. In Script Editor
type:
POSIX path of "some:Mac:Path"
or
(POSIX file "/My/Unix/path") as string
and hit Run.
But of course you want the API's underling this. Someone else?
Robert
Eric Albert - 27 Jul 2005 08:38 GMT
> This is not the answer you are looking for.
>
[quoted text clipped - 8 lines]
>
> But of course you want the API's underling this. Someone else?
See the APIs which take arguments of type CFURLPathStyle in CFURL.h.
Hope this helps,
Eric

Signature
Eric Albert ejalbert@cs.stanford.edu
http://outofcheese.org/
> I'm using libs that use UNIX fopen to open files but they require UNIX
> paths, i.e. if I do:
[quoted text clipped - 18 lines]
> should I assume that there is no such function (just like there is no
> Carbon function to copy files) shame, shame, shame...?
Look in Files.h You'll find a call that, given a Macintosh path return
an FSRef, and given an FSRef returns a POSIX path. The target object has
to exist to have an FSRef, so you often deal with pairs, where one
element is the deepest director that exists, and the other element of
the pair is a string that represents the rest of the path.

Signature
David Phillip Oster
jolielara@yahoo.com - 27 Jul 2005 09:15 GMT
If you mean ::FSRefMakePath I had already found it but the trouble is
it requires to be connected to the volume to which the path refers...
But I guess there is no way for the OS to map unresolved paths.
Thanks anyway, I'm bound to use this function.
David Phillip Oster a écrit :
> > I'm using libs that use UNIX fopen to open files but they require UNIX
> > paths, i.e. if I do:
[quoted text clipped - 24 lines]
> element is the deepest director that exists, and the other element of
> the pair is a string that represents the rest of the path.
Peter Paulus - 27 Jul 2005 12:57 GMT
I ran into the same problems, and in the end I wrote my own conversion
class. I couldn't find a decent way to do it with any of the available APIs.
The problem is even worse, because it depends on the way you mount the
volume. I found that when you SMB mount instead of AFP, there is a
hostname after the /Volumes, so
SMB mounted
/Volumes/hostname/Where/Ever/foo.txt.
AFP mounted
/Volumes/Where/Ever/foo.txt
And since there a 2 ways to AFP mount (afp over TCP/IP -
afp://hostname/... - and afp over AppleTalk - afp:/at/hostname/... -),
I'm not sure if that makes an other difference.
By the way, my conversion class is far from perfect, but it will be
adapted if the need arises. For now it does what I need it for.
With kind regards,
Peter Paulus
> If you mean ::FSRefMakePath I had already found it but the trouble is
> it requires to be connected to the volume to which the path refers...
[quoted text clipped - 32 lines]
>>element is the deepest director that exists, and the other element of
>>the pair is a string that represents the rest of the path.