discuss-gnustep
[Top][All Lists]
Advanced

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

Find value of GNUSTEP_XXX_APPS


From: Sebastian Reitenbach
Subject: Find value of GNUSTEP_XXX_APPS
Date: Sun, 19 Feb 2012 17:44:22 +0100
User-agent: SOGoMail 1.3.12

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];
        ...



reply via email to

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