ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Documentation/Categories/MiscAppExtensions.rtf

This is MiscAppExtensions.rtf in view mode; [Download] [Up]

Release 1.3  Copyright ©1993-1994 by Don Yacktman.  All Rights Reserved.






Application(MiscAppExtensions)






Declared In:	misckit/MiscAppExtensions.h





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
	± didAutolaunch
	± domainName
	± effectiveGroupIDNum
	± effectiveUserIDNum
	± groupIDNum
	± groupMemberForID:
	± groupMemberForString:
	± hostID
	±knowsDefaultValue:
	± realDomainName
	± 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)




didAutolaunch
- (BOOL)didAutolaunch 	

Returns wether the application was launched by the user or by some autolaunch mechanism (e.g. Service, Workspace autolaunch path,...).




domainName
- (NXAtom)domainName

Returns the name of the domain the machine is on.  See the man page for getdomainname() for more information.  This is identical to the ±realDomainName method, but exists for completeness and orthogonality of the API. Future implementations should take care of the NXHost mechansim and take is domain info into account. Then the hostName method should change to really return the host name only.

See also:  -realDomainName




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




knowsDefaultValue:
- (BOOL)knowsDefaultValue:(const char *)defName

Returns YES if the defaults system has a valid value for the specifed defaultName. Use this methdo before reading any valus. This gives you the chance the use app internal defaults. 




realDomainName
- (NXAtom)realDomainName

Returns the name of the domain the machine is on.  See the man page for getdomainname() for more information.

See also:  -domainName




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







These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.