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

  1. Path: sparky!uunet!gatech!usenet.ins.cwru.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: Help needed with GetFInfo()
  5. Date: 6 Jan 1993 20:54:43 GMT
  6. Organization: University of California; Santa Cruz
  7. Lines: 25
  8. Message-ID: <1ifgukINNj1u@darkstar.UCSC.EDU>
  9. NNTP-Posting-Host: am.ucsc.edu
  10.  
  11.  
  12. I'm using GetFInfo to get the TYPE and CREATOR codes of a file, but I'm having
  13. problems.  I'm passing the file's FSSpec to my function which looks like this:
  14.  
  15. void MyFunction(FSSpec inputFile)
  16. {
  17.     short    inFileRefNum;
  18.     FInfo    finderInfo;
  19.     char    *fileType    = (char *) &finderInfo.fdType;
  20.     char    *fileCreator    = (char *) &finderInfo.fdCreator;
  21.     
  22.     GetFInfo(inputFile.name, inputFile.vRefNum, &finderInfo);
  23.     ....
  24. }
  25.  
  26. I'm then using fileType and fileCreator.  Like this, I get garbage, but if I
  27. change the second argument to GetFInfo to 0 instead of inputFile.vRefNum, and
  28. the file I'm using is in the default directory, it works fine.  What am I
  29. missing??  The vRefNum from the FSSpec should be OK, right?  Argh.
  30.  
  31. Thanks.
  32.  
  33. -- 
  34. ________________________________________________________________________________
  35. james speth          finger for pgp 2.0 public-key           speth@cats.ucsc.edu
  36.