Re: How to get the current classic Sytem folder path?
Re: How to get the current classic Sytem folder path?
- Subject: Re: How to get the current classic Sytem folder path?
- From: TACKEL <email@hidden>
- Date: Mon, 10 Mar 2003 12:12:24 +0100
Hi Greg,
Once we have the OS
9 system folder
reference I have new
problems getting the
posix path. Could you
please take a look and
tell where the
problem is?
The path I got is /
System when it
should be /System
Folder
UInt8 path;
err =
FSRefMakePath(&
systemFSRef, &path,
255) ;
if (err == noErr){
NSString *
pathname = [NSString
stringWithUTF8String
:&path];
NSLog (pathname);
}
>
From: Greg Robbins
<email@hidden>
>
Date: Thu, 6 Mar
2003 19:16:23 -
0800
>
To: cocoa-
email@hidden
>
Subject: Re: How to
get the current
classic Sytem folder
path?
>
>
GetFolderName is
not the proper way to
get the System
Folder name. As the
>
docs for that
routine say,
>
>
---
>
The GetFolderName
function obtains the
name of the folder in
the folder
>
descriptor, not the
name of the folder on
the disk. The names
may differ for a
>
few special folders
such as the System
Folder. For relative
folders, however,
>
the actual name is
always returned.
>
---
>
>
GetFolderName is
returning "\
pSystem" because
the actual system
folder isn't
>
located by name by
the system.
>
>
Instead, use
FSFindFolder and
FSGetCatalogInfo to
get the name:
>
>
>
FSRef
systemFSRef;
>
>
OSErr err =
FSFindFolder(kClassic
Domain,
kSystemFolderType,
kDontCreateFolder,
>
&systemFSRef);
>
if (err == noErr)
>
{
>
HFSUniStr255
hfsUniName;
>
>
err =
FSGetCatalogInfo(&
systemFSRef,
kFSCatInfoNone,
NULL, &hfsUniName,
NULL,
>
NULL);
>
if (err == noErr)
>
{
>
NSString *name =
[NSString
stringWithCharacters
:hfsUniName.unicode
>
length:hfsUniName.le
ngth];
>
NSLog(name);
>
}
>
}
>
>
>
Greg Robbins
>
________________
________________
_______________
>
cocoa-dev mailing
list | cocoa-
email@hidden
>
Help/Unsubscribe/
Archives:
>
http://
www.lists.apple.com
/mailman/listinfo/
cocoa-dev
>
Do not post admin
requests to the list.
They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.