- Inherits from:
- NSObject
- Conforms to:
- NSObject
- (NSObject)
Declared in:
- Foundation/NSProcessinfo.h
The NSProcessInfo class provides methods to access process-wide information. An NSProcessInfo object can return such information as the arguments, environment variables, host name, or process name. The processInfo class method returns a shared NSProcessInfo object for the process. For example, the following line returns the NSProcessInfo object, which then provides the name of the current process:
NSString *processName = [[NSProcessInfo processInfo] processName];
NSProcessInfo also includes the operatingSystem method, which returns an enum constant identifying the operating system on which the process is executing.
- Getting an NSProcessInfo object
- + processInfo
- Returning process information
- - arguments
- - environment
- - hostName
- - processName
- - globallyUniqueString
- Returning the host operating system
- - operatingSystem
- - operatingSystemName
- Specifying a process name
- - setProcessName:
+ (NSProcessInfo *)processInfo
- (NSArray *)arguments
- (NSDictionary *)environment
- (NSString *)globallyUniqueString
See Also: - processName
- (NSString *)hostName
- (unsigned int)operatingSystem
NSWindowsNTOperatingSystem
NSWindows95OperatingSystem
NSSolarisOperatingSystem
NSHPUXOperatingSystem
NSMACHOperatingSystem
NSSunOSOperatingSystem
NSOSF1OperatingSystem
- (NSString *)operatingSystemName
- (NSString *)processName
See Also: - setProcessName:
- (void)setProcessName:(NSString
*)newName
User defaults and other aspects of the environment might depend on the process name, so be very careful if you change it. Setting the process name in this manner is not thread-safe.
See Also: - processName