[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find System folder?



I think Preference Folders were invented with System 7. Before
that, all preferences just cluttered up your System Folder.


At 4:31 AM 11/3/94, Peter Stone wrote:
 >I'm using the find-special-folder to find #$kPreferencesFolderType.
 >It works fine in System 7 but gives "unimplemented trap" error in
 >System 6.07. How to make it running in both?
 >
 >(defun find-special-folder (type &optional (create-p t))
 >  (let ((kCreate (if create-p #$kCreateFolder #$kDontCreateFolder)))
 >    (rlet ((vrefnum_p :Integer)
 >           (foundDirId_p :LongInt)
 >           (fsSpec_p  :FSSpec)
 >          )
 >      (#_FindFolder #$kOnSystemDisk type kCreate vrefnum_p foundDirId_p)
 >      (with-pstrs ((empty_cstr ""))
 >          (#_FSMakeFSSpec
 >            (%get-word vrefnum_p)
 >            (%get-long foundDirId_p)
 >            empty_cstr
 >            fsSpec_p
 >      ) )
 >      (%path-from-fsSpec fsSpec_p)
 >) ) )
 >
 >Peter