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: Sebastian Reitenbach
Subject: Re: Find value of GNUSTEP_XXX_APPS
Date: Sun, 19 Feb 2012 18:24:10 +0100
User-agent: SOGoMail 1.3.12

 
On Sunday, February 19, 2012 17:56 CET, Fred Kiefer <address@hidden> wrote: 
 
> Calling NSSearchPathForDirectoriesInDomains(NSApplicationDirectory, 
> NSSystemDomainMask, YES) should do the trick.

Thanks, I know there must have been something much easier, below snippet now 
works 
like a charm:
        gnustepSystemApps = 
[NSSearchPathForDirectoriesInDomains(NSApplicationDirectory,
                                NSSystemDomainMask, YES) objectAtIndex:0];

Sebastian

> 
> 
> 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
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/discuss-gnustep
> >
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep
 
 
 
 



reply via email to

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