Re: How to convert MAC paths to BSD (unix) paths?
- From: jolielara@xxxxxxxxx
- Date: 27 Jul 2005 01:15:05 -0700
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 :
> In article <1122372328.369988.114710@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
> jolielara@xxxxxxxxx wrote:
>
> > I'm using libs that use UNIX fopen to open files but they require UNIX
> > paths, i.e. if I do:
> >
> > FILE* pF = fopen("/Where/Ever/foo.txt", "rw"); // it works fine
> >
> > but if I do:
> >
> > FILE* pF = fopen("Macintosh HD:Where:Ever:foo.txt", "rw"); // it
> > fails...
> > pF is NULL.
> >
> > I managed to convert local MAC paths to BSD paths (paths like the ones
> > above) but how to do that for network volumes?
> >
> > I have: "TRANSIT:Where:ever:foo.txt" that maps to
> > "/Volumes/128.0.0.1/Where/Ever/foo.txt" in the terminal console (using
> > 'ls' and 'cd') where TRANSIT is a Samba mounted volume on the server
> > running Window$ 2003 (pro or server I don't remember well and don't
> > care actually) which IP address is 128.0.0.1...
> > Is there a way to convert this path to be able to send it to fopen or
> > 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.
>
> --
> David Phillip Oster
.
- Follow-Ups:
- Re: How to convert MAC paths to BSD (unix) paths?
- From: Peter Paulus
- Re: How to convert MAC paths to BSD (unix) paths?
- References:
- How to convert MAC paths to BSD (unix) paths?
- From: jolielara
- Re: How to convert MAC paths to BSD (unix) paths?
- From: David Phillip Oster
- How to convert MAC paths to BSD (unix) paths?
- Prev by Date: Re: How to convert MAC paths to BSD (unix) paths?
- Next by Date: Get QuickTime Image Buffer
- Previous by thread: Re: How to convert MAC paths to BSD (unix) paths?
- Next by thread: Re: How to convert MAC paths to BSD (unix) paths?
- Index(es):