Re: NSTask arguments

2013-02-20 Thread Ken Thomases
On Feb 20, 2013, at 10:31 PM, Kyle Sluder wrote: > On Feb 20, 2013, at 8:30 PM, Jens Alfke wrote: > >> On Feb 20, 2013, at 8:22 PM, Kyle Sluder wrote: >> >>> You can accomplish this without writing to the file system, but it >>> involves foregoing NSTask. Fork, close stdin in the child process

Re: NSTask arguments

2013-02-20 Thread Ken Thomases
On Feb 20, 2013, at 10:28 PM, Kyle Sluder wrote: > On Wed, Feb 20, 2013, at 08:22 PM, Kyle Sluder wrote: >> You can accomplish this without writing to the file system, but it >> involves foregoing NSTask. Fork, close stdin in the child process, open >> a pipe (so that the child gets the read end i

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
Oh crap, NOW I get it. :P You don't have to do the fork dance at all. Just call -setStandardInput: and pass /dev/stdin as the filename argument. Let NSTask take care of the rest. --Kyle Sluder On Wed, Feb 20, 2013, at 08:30 PM, Jens Alfke wrote: > > On Feb 20, 2013, at 8:22 PM, Kyle Sluder wro

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
On Feb 20, 2013, at 8:30 PM, Jens Alfke wrote: > > On Feb 20, 2013, at 8:22 PM, Kyle Sluder wrote: > >> You can accomplish this without writing to the file system, but it >> involves foregoing NSTask. Fork, close stdin in the child process, open >> a pipe (so that the child gets the read end i

Re: NSTask arguments

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 8:22 PM, Kyle Sluder wrote: > You can accomplish this without writing to the file system, but it > involves foregoing NSTask. Fork, close stdin in the child process, open > a pipe (so that the child gets the read end in fd 0), then exec the tool > with "/dev/stdin" as the fil

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
On Wed, Feb 20, 2013, at 08:22 PM, Kyle Sluder wrote: > You can accomplish this without writing to the file system, but it > involves foregoing NSTask. Fork, close stdin in the child process, open > a pipe (so that the child gets the read end in fd 0), then exec the tool > with "/dev/stdin" as the

Re: NSTask arguments

2013-02-20 Thread dangerwillrobinsondanger
On 2013/02/21, at 13:11, Jens Alfke wrote: > > On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: > >> Is there a way to feed an NSTask argument data when the command line tool in >> the task expects a file path argument? >> I would like to not actually create a file to u

Re: NSTask arguments

2013-02-20 Thread Kyle Sluder
On Wed, Feb 20, 2013, at 08:11 PM, Jens Alfke wrote: > You could conceivably create a fake volume in the filesystem that didn’t > correspond to any real file but just returned your data when read > (something like what the disk images driver does) … but the moment you > did this, your data would ex

Re: NSTask arguments

2013-02-20 Thread Jens Alfke
On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: > Is there a way to feed an NSTask argument data when the command line tool in > the task expects a file path argument? > I would like to not actually create a file to use as the argument, but rather > send data that would b

Re: NSTask arguments

2013-02-20 Thread John Joyce
On Feb 21, 2013, at 9:46 AM, Greg Parker wrote: > On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: >> Is there a way to feed an NSTask argument data when the command line tool in >> the task expects a file path argument? >> I would like to not actually create a file to use

Re: NSTask arguments

2013-02-20 Thread Greg Parker
On Feb 20, 2013, at 4:18 PM, dangerwillrobinsondan...@gmail.com wrote: > Is there a way to feed an NSTask argument data when the command line tool in > the task expects a file path argument? > I would like to not actually create a file to use as the argument, but rather > send data that would be

NSTask arguments

2013-02-20 Thread dangerwillrobinsondanger
Hi all Is there a way to feed an NSTask argument data when the command line tool in the task expects a file path argument? I would like to not actually create a file to use as the argument, but rather send data that would be in said file. Can this be done via NSFileHandle or NSPipe from NSData?