nstask

NoClassDefFoundError when running shell script

Here is the error: Exception in thread "main" java.lang.NoClassDefFoundError: org/alicebot/server/net/AliceServer Caused by: java.lang.ClassNotFoundException: org.alicebot.server.net.AliceServer at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net...

How to give permission using NSTask - objective-c

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 ...

AMShellWrapper sending data to a running task

I'm in the process of converting AMShellWrapper to my own application that runs an SH file that has userinput. Therefore, I need to send data to a running task. Any ideas? Elijah ...

AMShellWrapper not getting data after sending input

Using AMShellWrapper, I'm trying to send data to a running task. However, when I do so, nothing happens, no data is being sent nor received. Any ideas? ...

Obtaining admin privileges to delete files using rm from a Cocoa app

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/Logs The issue is that the user account does not have permissions to access some files in the system library folder, such as the Adobe logs sub...

NSTask with bash script problem

For example, i have this simple bash script: #!/bin/sh cd $1; And this cocoa wrapper for it: NSTask *cd = [[NSTask alloc] init]; NSString *testFolder = [NSString stringWithString:@"/Users/test/Desktop/test 1"]; [cd setLaunchPath:@"/bin/sh"]; [cd setArguments:[NSArray arrayWithObjects:[[NSBundle mainBundle] ...

Starting an SH file with NSTask

Here is my code: -(void)startTask{ NSString * cmd = @"/bin/sh"; pty_ = [[PseudoTTY alloc] init]; NSTask * task = [[NSTask alloc] init]; [task setStandardInput:[pty_ slaveFileHandle]]; [task setStandardOutput:[pty_ slaveFileHandle]]; [task setStandardError:[pty_ slaveFileHandle]]; [task setCurrentDirectoryPath:[@"~" stringByExpandingTi...

Catch credential needed with NSTask and rsync

Hi guys, Fist post for a french developer! I'm trying to create a simple synchronization using rsync and objective-c. So I used NSTask like that : NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/usr/bin/rsync"]; NSArray* args = [NSArray arrayWithObjects:@"-av", @"/Users/BiB1/Documents/test/", @"[email protected]:~/te...

How to use NSTask as root?

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 -rf / #Yes, really The problem is that simply using Substitute User Do (sudo) doesn't work as the user needs to enter the password to the no...