discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find value of GNUSTEP_XXX_APPS


From: Fred Kiefer
Subject: Re: Find value of GNUSTEP_XXX_APPS
Date: Sun, 19 Feb 2012 17:56:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1

Calling NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, NSSystemDomainMask, YES) should do the trick.


On 19.02.2012 17:44, Sebastian Reitenbach wrote:
Hi,

for Zipper, I was looking for an easy way to find out GNUSTEP_SYSTEM_APPS. I 
know I can use
gnustep-config  --variable=GNUSTEP_SYSTEM_APPS
on the command line to find that out.
Programmatically, I did the same, running it via NSTask, see the snippet at the 
end.
I wonder whether there is an easier way to get the value of such a variable?

Sebastian


         NSString *gnustepSystemApps;
         NSTask *task;
         NSPipe *pipe;
         NSFileHandle *readHandle;


         pipe = [NSPipe pipe];
         readHandle = [pipe fileHandleForReading];

         task = [[NSTask alloc] init];
         [task setLaunchPath:@"gnustep-config"];
         [task setArguments:[NSArray 
arrayWithObject:@"--variable=GNUSTEP_SYSTEM_APPS"]];
         [task setStandardOutput:pipe];
         [task launch];
         gnustepSystemApps = [[[NSString alloc] initWithData:[readHandle 
availableData]
                                 encoding:NSASCIIStringEncoding] autorelease];
         [task waitUntilExit];
         ...

_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustep@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep





reply via email to

[Prev in Thread] Current Thread [Next in Thread]