On 11/21/04 1:42 PM, Turbo3D didst favor us with:
> And now that we have the user directory, how to create a private
folder into it and then create some file this folder .
We got the FsRef of the user domain, but how to get a FsRef ( then a
FsSpec) to a non existing folder/file path ?
Why do you need an FSRef to an non-existent file or folder (not possible, by
the way)?
Why are you screwing around with this CFURL stuff? Have you not read through
Files.h?
extern OSErr
FSCreateDirectoryUnicode(
const FSRef * parentRef,
UniCharCount nameLength,
const UniChar * name,
FSCatalogInfoBitmap whichInfo,
const FSCatalogInfo * catalogInfo, /* can be NULL */
FSRef * newRef, /* can be NULL */
FSSpec * newSpec, /* can be NULL */
UInt32 * newDirID) /* can be NULL */
AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
extern OSErr
FSCreateFileUnicode(
const FSRef * parentRef,
UniCharCount nameLength,
const UniChar * name,
FSCatalogInfoBitmap whichInfo,
const FSCatalogInfo * catalogInfo, /* can be NULL */
FSRef * newRef, /* can be NULL */
FSSpec * newSpec) /* can be NULL */
AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
Read the headers. It will save you more time than you'll waste wandering
around in the dark like this.
OSStatus err = FSFindFolder(kUserDomain, kCurrentUserFolderType,
FALSE, &fsRef);
CFURLRef home = CFURLCreateFromFSRef(kCFAllocatorDefault, &fsRef);
CFURLRef path =
CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, home,
CFSTR("SomeFolder"), TRUE);
bOK= CFURLGetFSRef(path, &fsRef); // Does not work .... the folder
must already exist !... shit
Very professional. Thanks for sharing that with us.
Larry
result = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL,
&outSpec, NULL);
CFRelease(home);
CFRelease(path);
FSMakeFSRefUnicode does not work either.
Thanks
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden