Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: carbon-development digest, Vol 2 #1444 - 27 msgs



on 5/15/03 11:11 AM, email@hidden at
email@hidden wrote:

> Message: 9
> Date: Thu, 15 May 2003 05:39:51 -0400
> Subject: Re: How to get DirID
> From: Laurence Harris <email@hidden>
> To: Mamta Choudhary <email@hidden>,
> <email@hidden>
>
> To add to what some others have said...
>
> On 5/15/03 2:13 AM, Mamta Choudhary didst favor us with:
>
>> Hi,
>> I'm totally new to MAC OS so please bear with my stupid question. But I
>> really need help. Actually I'm trying to create a file for which I need to
>> create a FSSpec.
>
> FSSpecs are the old file specifier. They are discouraged now because, among
> other things, they don't support long Unicode file names.
>
>> I'm useing the function FSMakeFSSpec. In carbon
>> documentaiton it is specified that you must pass a valid directory id and
>> volume id in FSMakeFSSpec. But I could not find a function which gives me
>> the dirID by giving the path.
>
> My first question is, why are you using a path to specify a folder? There
> are almost always better ways to do this. I don't know the circumstances
> under which you're creating this file, so it's hard to give a definite
> answer. If it's a document file the user is saving, Navigation Services
> dialogs will provide and FSRef for the folder in which the file is to be
> saved. That and the name are all you need to create the file. If this is a
> file the application is creating on its own without interaction from the
> user, then it should probably be going in one of the special folders, and
> FSFindFolder will give you an FSRef to any of those you might need.
>
> If you're new to the Mac, depending on the areas you're coding, take time to
> read through some of the header files such as Files.h, MacWindows.h,
> Controls.h, ControlDefinitions.h, and Menus.h. Documentation is scarce for
> the newer APIs, and many times the best documentation is in the header
> files. For files, you should read TN 2078 - Migrating to FSRefs & long
> Unicode names from FSSpecs:
>
> http://developer.apple.com/technotes/tn2002/tn2078.html
>
> Larry
I believe it is valid to pass 0 for the directory id and volume id in
FSMakeFSSpec.
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.