nstask Questions

2

Solved

I'm working with Ionic which has a command line interface. I would like to create a small Mac app that helps to execute certain commands. In the terminal I cd Users/me/Desktop/Repos/ionic-project/...
Ceballos asked 21/5, 2015 at 13:34

1

I am trying to figure out how to pass input to a NSTask when prompted. Example: I do something like kinit username@DOMAIN and I get a "enter Password" prompt. I want to be able to supply the...
Unselfish asked 21/8, 2012 at 21:18

2

Solved

I have a PHP script which has mutliple sleep() commands. I would like to execute it in my application with NSTask. My script looks like this: echo "first\n"; sleep(1); echo "second\n"; sleep(1); e...
Ridings asked 3/8, 2011 at 18:55

1

Solved

I'm using NSTask to execute a series of long running commands like so: commandToRun = @"command 1;command2"; NSArray *arguments = [NSArray arrayWithObjects: @"-c", commandToRun, nil]; self.task...
Nidianidicolous asked 11/12, 2013 at 14:30

0

I’m working on a Mac OS app composed of a main app and a helper : Backup.app/ └── Contents ├── Library │ └── LoginItems │ └── BackupHelper.app ├── MacOS │ └── Backup Backup.app: ask the use...
Adamo asked 4/11, 2013 at 9:56

5

In an application I'm making I need to run the following command as root (user will be prompted trice if they really want to, and they will be asked to unmount their drives) using NSTask: /bin/rm -...
Gretel asked 29/10, 2010 at 9:41

1

Solved

I have been searching for days and hours for this, I have seen a lot of examples of this, but cannot figure out how NSTask works, let's say I wanted to execute the command killall Dock or defaults ...
Terzetto asked 31/7, 2013 at 16:49

1

Solved

Ok. There are several questions on stack overflow about this. This question was the only question comes closest to mines, but it uses notifications. The code is very simple. Create a new empty Mac...
Smallsword asked 27/6, 2013 at 10:20

2

Solved

Here is my code: task = [[NSTask alloc] init]; [task setCurrentDirectoryPath:@"/applications/jarvis/brain/"]; [task setLaunchPath:@"/applications/jarvis/brain/server.sh"]; NSPipe * out = [NSPipe ...
Fusil asked 9/8, 2010 at 21:3

3

I got a Cocoa command-line program in which I try to run NSTask program (tshark to monitor network) and get data from it in real-time. So I make a NSFileHandle , call waitForDataInBackgroundAndNo...
Dollydolman asked 20/1, 2012 at 17:57

1

I'm attempting to read data from the Standard Error of a NSTask in Cocoa using waitForDataInBackgroundAndNotify. The following code does read the stream, so it's already working partially. The pr...
Schock asked 8/4, 2013 at 19:17

2

I've been trying to make do (see this and this) with the recent NSUserScriptTask class and its subclasses and so far I've solved some problems, but some others remain to be solved. As you can see f...
Interfluent asked 25/3, 2013 at 13:6

0

Is there any way to cancel a running NSUserScriptTask? The only way that comes to mind is to launch a separate process (a command line tool) via NSTask, whose only purpose is to run the NSUserScrip...
Internee asked 24/3, 2013 at 14:12

3

Solved

I need to basically do a "sudo" but, I need to give that kind of permission to my NSTask code. Is this possible? Thanks, Elijah
Rectocele asked 22/8, 2010 at 13:36

1

Solved

I need to realize a communication between two threads using NSPipe channels, the problem is that I don't need to call terminal command by specifying this methods. [task setCurrentDirectoryPath:@"....
Sliest asked 19/12, 2012 at 21:46

1

What I'm trying to do My Cocoa app needs to run a bunch of command-line programs. Most of these are non-interactive, so I launch them with some command-line arguments, they do their thing, output ...
Missie asked 25/9, 2012 at 15:47

3

Solved

I've an open source project (gdal) that I want to compile and run as part of an iOS app. I had been expecting to use NSTask but I see now that it was removed in iOS 3.0. I've also seen elsewh...
Troup asked 8/10, 2009 at 8:24

1

Solved

I'm trying to put together a little RSync program for the hell of it, and I managed to get it to work with the code below. The only problem is that it only Rsyncs single files and not directories. ...
Papacy asked 27/5, 2012 at 15:2

1

Solved

I want to run dpkg ( or any other binary library files from cydia in the /bin or /usr/bin directories) from a GUI app with an icon, like mobileterminal, ifile, myfile, cydia, alertscript, and so ma...
Dizon asked 2/4, 2012 at 20:34

3

First of all, when debugging and running in Xcode everything works as expected. But when I try to "share" my app, i.e. make a release build, my NSTask won't output any standardOutput while standar...
Agraphia asked 24/11, 2011 at 9:22

1

Solved

I would like to embed a command-line executable in my Xcode/Cocoa project, to then start it with NSTask. Which path should I use in the setLaunchPath ? Thanks !
Swamper asked 4/2, 2012 at 22:44

4

Solved

What I have is NSTask running a long premade shell script and I want the NSProgressIndicator to check on how much is done. I've tried many things but just can't seem to get it to work. I know how t...
Newport asked 17/1, 2012 at 2:35

1

I am currently trying to wrap my head around the hole NSTask, NSPipe, NSFileHandle business. So I thought I write a little tool, which can compile and run C code. I also wanted to be able to redire...
Hypolimnion asked 14/6, 2011 at 22:5

2

Solved

I am making a small app that deletes log files. I am using an NSTask instance which runs rm and srm (secure rm) to delete files. I want to be able to delete files in: /Library/Logs ~/Library/Log...
Tai asked 27/8, 2010 at 23:34

1

Solved

In my Cocoa application I'm trying to use NSTask to run some basic Git commands. Whenever I run a command that requires permissions (SSH keys) to access a remote (e.g. git push, git pull), it fails...
Squeaky asked 3/6, 2011 at 3:20

© 2022 - 2024 — McMap. All rights reserved.