home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21117 < prev    next >
Encoding:
Internet Message Format  |  1993-01-10  |  1.5 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!darkstar.UCSC.EDU!cats.ucsc.edu!speth
  2. From: speth@cats.ucsc.edu (James Gustave)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: URGENT Help needed with PBHSetFInfo !!!
  5. Date: 10 Jan 1993 07:17:34 GMT
  6. Organization: University of California; Santa Cruz
  7. Lines: 39
  8. Message-ID: <1ioiieINN72a@darkstar.UCSC.EDU>
  9. NNTP-Posting-Host: am.ucsc.edu
  10.  
  11.  
  12. I have a file's FSSpec and I need to change some of its characteristics.
  13. I start by getting an HFileParam by calling PBHGetFInfo, then I change the
  14. necessary attributes, and use PBHSetFInfo.  There's no problem getting the
  15. HFileParam, but I get an error (-43 file not found) when setting it.
  16.  
  17. I thought that by calling PBHGetFInfo right before PBHSetFInfo, it would have
  18. all the right info to locate the file.  What am I doing wrong?
  19. Here's a sample of what I'm trying to do:
  20.  
  21. void test(FSSpec myFile)
  22. {
  23.     HFileParam  myFileParam;
  24.     OSErr       myErr;
  25.  
  26.     myFileParam.ioNamePtr = myFile.name;
  27.     myFileParam.ioVRefNum = myFile.vRefNum;
  28.     myFileParam.ioDirID   = myFile.parID;
  29.     myFileParam.ioFDirIndex = 0;
  30.  
  31.     myErr = PBHGetFInfo(&myFileParam, FALSE);
  32.  
  33.     if (myErr)
  34.         HandleTheError();
  35.  
  36.     myFileParam.ioFlFndrInfo.fdType    = 'APPL';
  37.     myFileParam.ioFlFndrInfo.fdCreator = 'JIMS';
  38.  
  39.     myErr = PBHSetFInfo(&myFileParam, FALSE);
  40.  
  41.     if (myErr)
  42.         HandleTheError();
  43. }
  44.  
  45. Thanks for the help.
  46.  
  47. -- 
  48. ________________________________________________________________________________
  49. james speth          finger for pgp 2.0 public-key           speth@cats.ucsc.edu
  50.