nstask Questions

1

I would like to open FileZilla (ftp application) with an argument. It is working with NSTask (aka. Process): let process:Process = Process() process.launchPath = appURL.path process.arguments = [...
Formica asked 3/10, 2016 at 7:24

2

It seems that NSTask calls -[NSString fileSystemRepresentation] to encode values for each of the arguments you give it. This can become a problem in some situations due to the fact that -fileSyste...
Facultative asked 27/8, 2013 at 7:41

2

I have a sub-app in my main Swift app. I made it so it's copied automatically in the Resources folder of the main app when building it. That way, I want to be able to launch an instance of the sub-...
Olva asked 30/6, 2016 at 20:23

4

Solved

I'm using an NSTask to run rsync, and I'd like the status to show up in the text view of a scroll view inside a window. Right now I have this: let pipe = NSPipe() task2.standardOutput = pipe task2...
Halden asked 9/4, 2015 at 20:55

3

Solved

I'm trying to make a NSTask running a command like this: ps -clx | grep 'Finder' | awk '{print $2}' Here is my method - (void) processByName:(NSString*)name { NSTask *task1 = [[NSTask alloc]...
Racine asked 22/2, 2012 at 17:55

5

Solved

I don't know why this method returns a blank string: - (NSString *)installedGitLocation { NSString *launchPath = @"/usr/bin/which"; // Set up the task NSTask *task = [[NSTask alloc] init]; [t...
Oribella asked 22/12, 2008 at 17:18

0

My app I have a Mac app that uses AsciiDoctor under the hood to generate PDF and ePUB files. I use the Process class (formerly NSTask) to run the AsciiDoctor commands. What I want I want people ...
Klara asked 11/2, 2019 at 22:35

1

Solved

I'm trying to use a Pipe's fileHandleForReading's readabilityHandler to read both the standardOutput and standardError of a Process. However, the moment the terminationHandler is called is actually...
Dropout asked 14/9, 2018 at 15:52

5

I'm writing an application that kicks off a subprocess running a simple web server. I am using NSTask and communicating with it with pipes, and everything seems more or less fine. However, if my pr...
Yardstick asked 18/8, 2009 at 19:33

3

I need to use NSTask synchronously, however I find that occasionally my task hangs under the 'waitUntilExit' command. I wonder if there is a graceful way--an error handling method--to terminated th...
Sibel asked 29/10, 2015 at 20:29

1

Solved

In the most recent Apple documentation both NSTask and Process have several deprecated methods and properties, although there's nothing marked with an API Availability Macro. Instance Properties ...
Bruce asked 15/11, 2017 at 18:49

5

Solved

I am using the following code in my Cocoa project to call a script I made. The script is in the same folder as the project and even shows up under the "Resources" folder in Xcode. The proper path i...
Taranto asked 11/7, 2010 at 0:54

2

Solved

I know how to send data to the task: NSData *charlieSendData = [[charlieImputText stringValue] dataUsingEncoding:NSUTF8StringEncoding]; [[[task standardInput] fileHandleForWriting] writeData:charl...
Malathion asked 9/8, 2010 at 19:15

2

Solved

I am trying to read the contents of a URL synchronously for a simple command-line batch script in Swift. I am using cURL for simplicity's sake - I know I could use NSURLSession if I had to. I am al...
Conscript asked 15/3, 2016 at 10:52

2

My goal is to create an extension that executes clang-format. My code looks something like this: - (void)performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandle...
Papst asked 9/9, 2016 at 14:26

2

Solved

I am writing a Cocoa application which needs to execute a UNIX program and read its output, line by line, as they are produced. I set up a NSTask and NSPipe as such: task = [[NSTask alloc] init]; ...
Dunc asked 15/11, 2012 at 5:58

4

Solved

I'm running the PHP CLI through a NSTask in MacOS, but this question is more about the CLI itself. I'm listening to the stderr pipe, but nothing is output there no matter what file I try to run: ...
Nelda asked 22/6, 2011 at 23:3

2

Solved

I'm trying to run a shell script with NSTask with the following code: NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/Users/username/connect.sh"]; [task launch]; But I get An uncaug...
Haddington asked 28/8, 2014 at 23:38

2

Solved

I have a multithreaded program that needs to run many executables at once and wait for their results. I use [nstask waitUntilExit] in an NSOperationQueue that runs it on non-main thread (running ...
Cynthea asked 25/1, 2016 at 16:2

1

I'm currently working on an application that collects information from text fields in an OS X application, then access the openssl binary to generate a CSR and a Private Key based on those text fie...
Abbacy asked 23/12, 2015 at 17:1

1

I seem to get a lot of crash reports like this: Crashed Thread: 14 Exception Type: EXC_GUARD Exception Codes: 0x4000000200000000, 0x00007fff96f73c48 Thread 14 Crashed: 0 libsystem_kernel.dylib 0...
Interplead asked 14/5, 2014 at 23:29

2

Solved

I'm trying to run a simple bash script using NSTask and direct the output to a text view. Once the task is executed, the CPU usage of my app is 100%, even though it's a simple echo (for now). I cr...
Hepta asked 6/12, 2012 at 15:44

3

Solved

I am writing a simple terminal using openpty, NSTask and NSTextView. How are CtrlC and CtrlD supposed to be implemented? I start a shell like this: int amaster = 0, aslave = 0; if (openpty(&a...
Trackandfield asked 21/1, 2014 at 23:10

2

Solved

I'm using NSTask, but when I launch the task it blocks the main thread (so I can't update it) until the task ends. This is my code: NSString *hostsforping = @"google.es"; pingdata = [[NSTask allo...
Trammel asked 6/10, 2011 at 15:18

1

Solved

I am trying to run a terminal command in a Mac app that I am developing. The terminal command is: sudo sysctl -w net.inet.tcp.delayed_ack=0 I have tried using NSTask but it seems that I am doing...
Slay asked 2/7, 2015 at 19:9

© 2022 - 2024 — McMap. All rights reserved.