Page 1 of 1

GLoAppFolder.sit - support for accessing application folder

Posted: November 13th, 1997, 11:00 am
by Info-Mac
Download: http://archive.info-mac.org/dev/src/glo-app-folder.hqx

GLoAppFolder class
Copyright © 1997 Gregory Lo. All rights reserved.
Description:
This class provides some support for accessing files and
subfolders in the same folder as the application.

Notes:
Near the start of your application, just make a call to
GLoAppFolder::Startup(); This initializes a static FSSpec with the
location of your application.

Various calls are provided to create modified FSSpecs based on
this one; and open resource files in those places.

You can change the FSSpec using file or folder name strings from a
string list resource, or via a pointer to a pascal string. For
instance:

* osErr = GLoAppFolder::MakeFSSpec( "\pPlugins", myNewFSSpec );
* osErr = GLoAppFolder::MakeFSSpec( kFolderNamesID,
kPluginsFolderName, myNewFSSpec );

* refNum = GLoAppFolder::OpenResFile( "\pSounds", fsRdPerm );
* refNum = GLoAppFolder::OpenResFile( kFileNamesID,
kSoundsFileName, fsRdPerm );

Other information accessors are provided.

* vRefNum = GLoAppFolder::GetVolumeRefNum();
* parID = GLoAppFolder::GetParentID();

* myConstFSSpecPtr = GLoAppFolder::GetAppFileFSSpecPtr();
* myConstFSSpecRef = GLoAppFolder::GetAppFileFSSpec( void );

Change history:
04Nov1997 * Updated documentation
Contacting the Author:
email: * [email protected]
* [email protected] (before May, 1998)
License:

License is given to freely use this in any of your code:
commercial, or otherwise. Send me a postcard or email if you do.
Copyright © 1997 Gregory Lo. All rights reserved.