home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / mac / programm / 12932 < prev    next >
Encoding:
Text File  |  1992-07-23  |  1.7 KB  |  48 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!mips!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!po.CWRU.Edu!jxs18
  3. From: jxs18@po.CWRU.Edu (Jerry Sy)
  4. Subject: Re: PROGRAMMING PROB: How do you find the system folder?
  5. Message-ID: <1992Jul23.170016.11326@usenet.ins.cwru.edu>
  6. Sender: news@usenet.ins.cwru.edu
  7. Nntp-Posting-Host: cwns1.ins.cwru.edu
  8. Reply-To: jxs18@po.CWRU.Edu (Jerry Sy)
  9. Organization: Case Western Reserve University, Cleveland, OH (USA)
  10. References: <1992Jul22.183946.20587@CS.ORST.EDU>  
  11. Date: Thu, 23 Jul 92 17:00:16 GMT
  12. Lines:       35
  13.  
  14.  
  15. In a previous article, gonzalm@prism.cs.orst.edu (Mario Gonzales) says:
  16.  
  17. >
  18. >Hi all,
  19. >
  20. >I have looked in vain to find the function that will return the loaction of
  21. >the system folder.  I can find the boot disk but the system folder is
  22. >not allways called the "system folder" on the startup disk.
  23. >
  24. >Also what is the easiest way to traverse the entire directory structure
  25. >of a disk?
  26. >
  27. >If possible could you provide code samples?
  28. >
  29. >Any help is most appreciated!
  30. >
  31. >
  32. To locate a particular folder (that is, to find its volume reference
  33. number and directory ID), use the FindFolder routine:
  34.  
  35. pascal OSErr FindFolder(short vRefNum, OSType folderType,
  36.         Boolean createFolder, short *foundVRefNum,
  37.         long *foundDirID);
  38. where you supply vRefNum= kOnSystemDisk , to look in boot volume
  39.         folderType = kSystemFolderType, you want the Sys Folder right ?
  40.     createFolder= FALSE, you don't want to create a new folder if not found
  41.  
  42. and you get in return your foundVRefNum and foundDirID
  43.  
  44. the above code is from Programming for System 7 by Gary Little.
  45. Get this book, highly recommended.  
  46.  
  47.  
  48.