Up

NSProcessInfo class reference

Authors

Georg Tuparev (Tuparev@EMBL-Heidelberg.de)
Richard Frith-Macdonald (rfm@gnu.org)

Version: 1.98

Date: 2004/01/11 04:49:10

Copyright: (C) 1995-2001 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSProcessInfo class
  2. Software documentation for the NSProcessInfo(GNUstep) category

Software documentation for the NSProcessInfo class

NSProcessInfo : NSObject

Declared in:
Foundation/NSProcessInfo.h
Standards:

Description forthcoming.

Method summary

processInfo

+ (NSProcessInfo*) processInfo;

Returns the shared NSProcessInfo object for the current process.


arguments

- (NSArray*) arguments;

Returns an array containing the arguments supplied to start this process. NB. In GNUstep, any arguments of the form --GNU-Debug=... are not included in this array... they are part of the debug mechanism, and are hidden so that setting debug variables will not effect the normal operation of the program.


environment

- (NSDictionary*) environment;

Returns a dictionary giving the environment variables which were provided for the process to use.


globallyUniqueString

- (NSString*) globallyUniqueString;

Returns a string which may be used as a globally unique identifier.
The string contains the host name, the process ID, a timestamp and a counter.
The first three values identify the process in which the string is generated, while the fourth ensures that multiple strings generated within the same process are unique.


hostName

- (NSString*) hostName;

Returns the name of the machine on which this process is running.


operatingSystem

- (unsigned int) operatingSystem;

Return a number representing the operating system type.
The known types are listed in the header file, but not all of the listed types are actually implemented... some are present for MacOS-X compatibility only.


operatingSystemName

- (NSString*) operatingSystemName;

Returns the name of the operating system in use.


processIdentifier

- (int) processIdentifier;

Returns the process identifier number which identifies this process on this machine.


processName

- (NSString*) processName;

Returns the process name for this process. This may have been set using the -setProcessName: method, or may be the default process name (the file name of the binary being executed).


setProcessName:

- (void) setProcessName: (NSString*)newName;

Change the name of the current process to newName.


Software documentation for the NSProcessInfo(GNUstep) category

NSProcessInfo(GNUstep)

Declared in:
Foundation/NSProcessInfo.h
Standards:

Description forthcoming.

Method summary

initializeWithArguments:count:environment:

+ (void) initializeWithArguments: (char**)argv count: (int)argc environment: (char**)env;

Fallback method. The developer must call this method to initialize the NSProcessInfo system if none of the system-specific hacks to auto-initialize it are working.


debugLoggingEnabled

- (BOOL) debugLoggingEnabled;

Returns a indication of whether debug logging is enabled. This returns YES unless a call to -setDebugLoggingEnabled: has been used to turn logging off.


debugSet

- (NSMutableSet*) debugSet;

This method returns a set of debug levels set using the --GNU-Debug=... command line option and/or the GNU-Debug user default.
You can modify this set to change the debug logging under your programs control... but such modifications are not thread-safe.


setDebugLoggingEnabled:

- (void) setDebugLoggingEnabled: (BOOL)flag;

This method permits you to turn all debug logging on or off without modifying the set of debug levels in use.


setLogFile:

- (BOOL) setLogFile: (NSString*)path;

Set the file to which NSLog output should be directed.
Returns YES on success, NO on failure.
By default logging goes to standard error.



Up