Release 1.2  Copyright ã1993-1994 by Don Yacktman.  All Rights Reserved.

Application(MiscAppExtensions)

Declared In:	misckit/ExtendedApp.h
	ExtendedApp.h (a link; it is the required location for use in the IB/PB generated main() )

Category Description

The MiscAppExtensions category provides extra information about an application, making it easy to find out more about the application's environment.  It provides things such as the directory of the application, the user and group ID's that are applicable for the application, the user's home directory, the full name of the user, the host ID of the machine, and so on.  Basically, it provides a convenient wrapper around several typical UNIX functions.

If you used the NEXTSTEP 2.x version of this object, note that with the advent of NEXTSTEP 3.0, the ±appDirectory method became redundant, and has therefore become a wrapper around the appropriate NXBundle function.  (This means±or at least implies±that it no longer provides a trailing ª/º on the directory name, too.  If you wish to retain that behavior, you could do it with a subclass of Application which overrides this method, or use a category to add a new method with the desired behavior.)

Method Types

Getting information	± appDirectory
	± effectiveGroupIDNum
	± effectiveUserIDNum
	± groupIDNum
	± groupMemberForID:
	± groupMemberForString:
	± hostID
	± realHostName
	± realNameFor:
	± userHomeDirectory
	± userIDNum
	± userLoginName
	± userRealName

Instance Methods

appDirectory
- (const char *)appDirectory

Returns the directory in which the application's executable resides (the app wrapper).  There is no trailing ª/º on the path name, so if you plan to concatenate a file name to the path, don't forget to first append the ª/º.

See also:  -directory (NXBundle class)

effectiveGroupIDNum
- (int)effectiveGroupIDNum

Returns the results of the getegid() function.

See also:  -effectiveUserIDNum,  -groupIDNum, and -userIDNum.

effectiveUserIDNum
- (int)effectiveUserIDNum

Returns the results of the geteuid() function.

See also:  -effectiveGroupIDNum,  -groupIDNum, and -userIDNum.

groupIDNum
- (int)groupIDNum

Returns the results of the getgid() function.

See also:  -effectiveGroupIDNum,  -effectiveUserIDNum, and -userIDNum.

groupMemberForID:
- (BOOL)groupMemberForID:(gid_t)anId

Returns YES is the user running the application is a member of the group specified by anId.  Returns NO otherwise.

See also:  -groupMemberForString:,  -effectiveGroupIDNum, and -groupIDNum.

groupMemberForString:
- (BOOL)groupMemberForString:(const char *)aString

Returns YES is the user running the application is a member of the group specified by aString.  Returns NO otherwise.

See also:  -groupMemberForID:,  -effectiveGroupIDNum, and -groupIDNum.

hostID
- (unsigned long int)hostID

Returns the results of the gethostid() function.  This value is unique to the hardware.

See also:  -realHostName

realHostName
- (NXAtom)realHostName

Returns the host name as returned by the gethostname() function.

See also:  -hostID

realNameFor:
- (NXAtom)realNameFor:(NXAtom)userId

Returns the full name for the user with login name userId.    This method is used to find the name of the user running the application for the ±userRealName method below.

See also:  -userLoginName and -userRealName

userHomeDirectory
- (NXAtom)userHomeDirectory

Returns the home directory of the user who ran the application as found by NXHomeDirectory().

userIDNum
- (int)userIDNum

Returns the results of the getuid() function.

See also:  -effectiveGroupIDNum,  -effectiveUserIDNum, and -groupIDNum.

userLoginName
- (NXAtom)userLoginName

Returns the results of the NXUserName() function, which returns the login name of the user who ran the application.

See also:  -realNameFor: and -userRealName

userRealName
- (NXAtom)userRealName

Returns the full name of the user who ran the application.

See also:  -realNameFor: and -userLoginName