Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!convex!lamont From: lamont@convex.com (Bradley Lamont) Newsgroups: comp.sys.mac.programmer Subject: problems with FSWrite Keywords: FSWrite Message-ID: Date: 23 Jun 91 23:07:46 GMT Sender: usenet@convex.com (news access account) Organization: CONVEX Computer Corporation, Richardson, Tx., USA Lines: 45 Nntp-Posting-Host: trojan.convex.com I am hoping someone can help me with this problem. I am running on a Mac SE w/2.5 meg and a 20 meg drive under system 7.0. I am running Think C 4.0.5. I can't get the FSWrite command to work. I use SFGetFile to get a filename and number, create the file, open it, and then try to write an array to it. The first 3 commands (FSCreate,FSOpen,FSSetFPos) return error codes of 0 meaning the operation was successful (right??). When I use FSWrite, it returns a code of -34 (Disk full). I know I have over 2 meg free on the drive. I then quit out of my program back into Think C and when I try to quit, edit, or do any disk operation, my SE crashes and reboots (I have Macsbug running and it the crash doesn't even fall into Macsbug, it just reboots) The code is similiar to: SFPutFile (dlgOrigin, "\pSave under what name?", "\p", NIL, &theReply); if (theReply.good) { resultCode = Create (theReply.fName, theReply.vRefNum, 'BLKI', 'STNT'); /* resultCode = 0 at this point */ resultCode = FSOpen (theReply.fName, theReply.vRefNum, &theFile); /* again resultCode = 0 */ resultCode = SetFPos (theFile, fsFromStart, 0); /* resultCode = 0 */ resultCode = FSWrite (theFile, STUNT_FILE_SIZE, (**wData).map); /* resultCode = -34 */ } I have HLocked wData in the heap, map is an array[29][38], and STUNT_FILE_SIZE is 29*38=1102. Can anyone please help me? Please respond by e-mail. Thanks, Brad Lamont lamont@trojan.convex.com Convex Computer Corp. lamont@ux1.cso.uiuc.edu The University of Illinois at Urbana/Champaign