Re: Setting a blank ("") argument in NSTask
Re: Setting a blank ("") argument in NSTask
- Subject: Re: Setting a blank ("") argument in NSTask
- From: Daniel DeCovnick <email@hidden>
- Date: Mon, 25 Apr 2005 00:38:45 -0400
How about [NSString string];?
-Dan
Daniel DeCovnick
danhd123 at mac dot com
Softyards Software
http://www.softyards.com
On Apr 25, 2005, at 12:29 AM, Ben Borofka wrote:
When I try to do this, it puts "" as the value of blah. It needs to be blank. Any other ideas?
BenĀ
On Apr 24, 2005, at 4:29 PM, Todd Blanchard wrote:
I'm totally shooting in the dark here but did you try @"\"\"" (pair of quotes)?
If you can't make this work at all, you could fall back to the unix system() call. Invoke the shell as the executable and pass it the command line you want to perform as the argument.
On Apr 24, 2005, at 4:22 PM, Ben Borofka wrote:
I need to set a blank, empty argument (like "") in an NSTask, and I'm not sure how to do this.
I'm trying to do this:
<x-tad-bigger>$ dscl . create /users/test blah "" // Create a netinfo property with no value</x-tad-bigger>
I don't know how to set the "" in my NSTask arguments. NSTask is not supposed to work with single or double quotes you have to type in the command line. I've tried all sorts of things. I've tried putting an empty NSString.
<x-tad-bigger>[dscl_13 setArguments:[NSArray arrayWithObjects:@".", @"create", @"/users/test", @"blah", empty_string, nil]];</x-tad-bigger>
I've tried just putting nothing between quotes:
<x-tad-bigger>[dscl_13 setArguments:[NSArray arrayWithObjects:@".", @"create", @"/users/test", @"blah", @"", nil]];</x-tad-bigger>
And nothing works. I get errors when I run the program. What can I put in there to make it a blank argument in this case?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden