Skip navigation.
 
mlRe: pathnames in Tiger not showing volume name
FROM : Herb Petschauer
DATE : Wed Jan 30 23:10:19 2008

So apparently I can't read.  Tiger/Leopard they're both cats...

Indeed, I ran my test under 10.5. Under 10.4 I see the behaviour that
you are seeing.

Under 10.4, if I mount two shared directories (DEV and FOO) from the
same machine (say timmy.company.com) then I see "timmy.company.com"
and "timmy.company.com-1" in the /Volumes folder

I get better info from a "df" command in the Terminal.

Now, if I get the DumpVolumeInfo sample from developer.apple.com and I do this:

./DumpVolume -c /Volumes/timmy.company.com

it reports the volume name as "DEV".

So, you need to be calling FSGetVolumeInfo().
[you can create a FSVolumeRefNum via FSGetCatalogInfo()].

Take a look at the DumpVolumeInfo sample:  PrintFSGetVolumeInfo(...)

There may be a lower level Cocoa way of doing this but there you go...

Cheers,
-H.

On 30/01/2008, Michael Hanna <<email_removed>> wrote:
> Hi Herb!
>
> This is on Tiger? I just tried what you suggested like this:
>
>    if (FSPathMakeRef((const UInt8 *)[filePath
> fileSystemRepresentation], &fileRef, &isDirectory) == noErr)
>    {
>
>        CFURLRef theURL = CFURLCreateFromFSRef( kCFAllocatorDefault, &fileRef );
>        NSURL *fileURL = (NSURL*)theURL;
>
>        NSLog(@"[fileURL path] %@", [fileURL path]);
>    }
>
> and the -path I get back is identical to the [NSString
> -fileSystemRepresentation](contains the smbfs server name, not the
> name of the actual smb volume).
>
> Michael
>
> On Jan 30, 2008 8:58 AM, Herb Petschauer <<email_removed>> wrote:
> >
> > On 30/01/2008, Michael Hanna <<email_removed>> wrote:
> > > Hi there, I've run into a problem with pathnames that have been
> > > dragged-and-dropped on a window. They are exactly like the paths which
> > > you'd expect from -fileSystemRepresentation. In Leopard, the pathnames
> > > from an SMB mount I will get from the Finder are like:
> > >
> > > /Volumes/SMB_Mount/Files/AnnualReport_Cover.pdf
> > >
> > > but in Tiger I would get something like:
> > >
> > > /Volumes/SMB_Server/Files/AnnualReport_Cover.pdf
> > >
> > > where I'll get the server name and not the volume name.
> > >
> > > I've been hacking these paths to create a UNC path, but on Tiger this
> > > is impossible because I can't get the Volume name.
> > >
> > > Perhaps there's a better, more general way to create paths in
> > > Carbon(for instance)? I've tried creating an FSRef, but being very
> > > Carbon ignorant have just been stabbing in the dark with it. For
> > > instance, I tried to make an NSURL from CFURLCreateFromFSRef hoping
> > > that would give me something more general, but that didn't change
> > > anything.
> > >
> > > Michael
> >
> > Oddly enough, I'm Cocoa ignorant but a bit more Carbon savvy :-)
> >
> > Actually I've got a Foundation tool that accepts files dragged onto
> > the application icon.  My handler for this accepts an NSURL.  All I do
> > is call the NSURL's "path" method and the path I get is something like
> >
> > /Volumes/DEV/somefile.txt.
> >
> > I admit that may be different than your situation but it does seem to
> > be possible to get the path you are looking for...
> >
> > Cheers,
> > -H.
> >
>

Related mailsAuthorDate
mlpathnames in Tiger not showing volume name Michael Hanna Jan 30, 15:53
mlRe: pathnames in Tiger not showing volume name Herb Petschauer Jan 30, 17:58
mlRe: pathnames in Tiger not showing volume name Michael Hanna Jan 30, 20:31
mlRe: pathnames in Tiger not showing volume name Herb Petschauer Jan 30, 23:10
mlRe: pathnames in Tiger not showing volume name Dominik Pich Jan 31, 02:38