Questions tagged [nspipe]

34 questions
0
votes
1 answer

Strange issue of output via NSPipe when execute shell command using NSTask

Here is my codes. When I set myCmd=@"cd /\nls -l\n" or myCmd=@"ls -l\n", it's no problem. However, when I set myCmd=@"cd /\n", program is dead in the line if ((output =[[outPipe fileHandleForReading] availableData]) && [output length]) and there is…
Tom Jacky
  • 203
  • 1
  • 7
  • 20
0
votes
1 answer

Objective-c: How to use NSPipe output the illegal command echo in a NSTask?

I have code like following, it's ok, but I have 2 question about it. 1) If I assign some illegal para to sh, for example @"ls - l", then the outString is null. That is to say, it can not capture the error warning "ls: -: No such file or…
Tom Jacky
  • 203
  • 1
  • 7
  • 20
-1
votes
2 answers

Modify stringValue of NSTextField in Swift

I am trying to change the content of NSTextField in the ViewController by changing its stringValue coming from AppDelegate, but it gives me an error. The code in AppDelegate is: class AppDelegate: NSObject, NSApplicationDelegate { var…
Jack44
  • 17
  • 6
-3
votes
1 answer

Swift NStask function

I'm a complete swift noob. Using this code in xcode I get the result I need. I created a command line binary "menubar" that takes several arguments. I normally run it in the terminal "/bin/menubar getip", "/bin/menubar/getuser". I want to create a…
nyitguy
  • 598
  • 4
  • 18
1 2
3