Programming using CodeWarrior

I have a question regarding FSSpec in C
I do not know what its structure is??

I need to access a file whose name I know and want to use FSSpec to open it or do any other kind of access with it.

Can we identify the FSSpec of a file which is going to be created on the disk?

It would be helpful if u could give me a site to help me find more details on everything associated to file handling..it could be any kind of file.  My file contains image data and is created by a software known as IPLab.
AnubaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The_RavenCommented:
FSSpec is a structure that is located in the Files.h file in the Universal Headers (from Apple).

struct FSSpec {
      short            vRefNum;
      long            parID;
      StrFileName  name;
};

(StrFileName = a Str63 on MacOS)

To fill an FSSpec structure use the following call:

FSMakeFSSpec(short vRefNum,long dirID,
ConstStr255Param fileName,FSSpec *spec);

Use the FSSpec to pass into FSOpen(...)

Resources:

http://developer.apple.com/techpubs/mac/Files/Files-2.html

Hope it helps
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AnubaAuthor Commented:
Thank u for ur suggestion, but my question isn't fully answered.  The problem is that I want say the user to decide where that file must be held.  So let's say he decide to create this new file in a directory called A.  Now how does one get the dirID/parID and vRefNum to pass to the function FSMakeFSSpec,  I don't have any idea about that.  

My software must be able to get a filename from the user and then be able to store the images captured in it.  For this I thought of using the StandardGetFile function, but then whatever is the directory or vrefnum must be known or received for me to pass it to FSMakeFSSpec.

Thanks again Raven,
Anita.
0
trottieaCommented:
Maybe you should use StandardPutFile instead of StandardGetFile.
0
The_RavenCommented:
StandardFileReply myReply;

StandardPutFile("Save as:", "Default Name", myReply);

if (myReply.sfGood == true)
{
  FSpCreate(myReply.sfFile, 'ttxt', 'TEXT', smSystemScript);


}


There is a little sample.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.