#include #include #include #include "Wolfdef.h" #include #include "prefs.h" typedef struct { Byte fileName[34]; /* Enough space for filename */ OSType creator; /* Creator TYPE */ OSType fileType; /* File type */ OSType resType; /* Resource type */ short resID; /* Open resource file ID */ } PrefsInfo; static PrefsInfo prefsInfo; /* My internal prefs record */ static Boolean prefsInited = FALSE; /* Is the struct valid? */ /********************************** I miss the Apple IIgs where all you need to set the prefs directory was to pass a filename of "@:Prefs file" and it will automatically place the prefs file in either the proper Network folder or system prefs folder... Instead I have to do this bullshit to scan the volumes to find the prefs folder and volume... If the file was not found, then create it. return TRUE if the file was found and could not be created **********************************/ static Boolean FindPrefsFile(short *prefVRefNum, long *prefDirID) { OSErr theErr; long response; CInfoPBRec infoPB; if (!prefsInited) { /* Only look if the prefs structure is valid */ return FALSE; /* Exit NOW! */ } /* First, try it the easy way... */ if ( !Gestalt(gestaltFindFolderAttr, &response) && /* Is the easy way available? */ ( (1<