• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple File System Programming in Carbon
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple File System Programming in Carbon


  • Subject: Simple File System Programming in Carbon
  • From: John Reed <email@hidden>
  • Date: Tue, 16 Jan 2007 11:38:41 -0500

Help with the File System

I'm trying to implement a standard "Save" function in my code and am having 
trouble.  I had this down in OS 9, but now it seems there is more involved a
nd I can't figure out what I'm missing.

Here's my code (I already successfully implemented a Nav dialog and got a fi
lename in my NavReplyRecord, but all the subsequent calls require a FSRef an
d I can't figure out where I'm supposed to get that.


// Create new file

forkNameLength = sizeof reply.saveFileName;

status = FSCreateFileUnicode( &ref, forkNameLength, (UniChar*)reply.saveFile
Name, 0, NULL, newRef, NULL );


// Open fork

status = FSOpenFork( &ref, forkNameLength, (UniChar*)reply.saveFileName, per
missions, &forkRefNum );

// Set write position
status = FSSetForkPosition( forkRefNum, positionMode, positionOffset );

// Write data
requestCount = sizeof VELOCITY; // some test data
status = FSWriteFork( forkRefNum, positionMode, positionOffset, requestCount
, &buffer, &actualCount );


status = FSCloseFork( forkRefNum );

THIS ISN'T WORKING - I think it's the ref field which I haven't yet acquired.

Help would be appreciated (I've tried looking at example code but I have a r
eal hard time following other people's code - and I don't learn as much).

Thanks,
John
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Simple File System Programming in Carbon
      • From: Laurence Harris <email@hidden>
  • Prev by Date: Re: How-To create a document bundle
  • Next by Date: Re: Simple File System Programming in Carbon
  • Previous by thread: Re: How-To create a document bundle
  • Next by thread: Re: Simple File System Programming in Carbon
  • Index(es):
    • Date
    • Thread