Re: NSTask & curl

2009-06-07 Thread Dave Camp
On Jun 6, 2009, at 3:18 PM, Ammar Ibrahim wrote: On Sun, Jun 7, 2009 at 1:09 AM, Bill Bumgarner wrote: On Jun 6, 2009, at 3:05 PM, Ammar Ibrahim wrote: Thanks that fixed it! Although when you call it directly from the command line, it's fine to have the space there! I'd argue that fixe

Re: NSTask & curl

2009-06-06 Thread Andrew Farmer
On 6 Jun 2009, at 15:05, Ammar Ibrahim wrote: On Sun, Jun 7, 2009 at 12:29 AM, Andrew Farmer wrote: Given downloadFilePath /foo/bar/baz, this'll create a file called " baz" - with a leading space. Either use "-o%@" or use two separate arguments. Thanks that fixed it! Although when you c

Re: NSTask & curl

2009-06-06 Thread Wayne Packard
On Jun 6, 2009, at 3:18 PM, Ammar Ibrahim wrote: On Sun, Jun 7, 2009 at 1:09 AM, Bill Bumgarner wrote: On Jun 6, 2009, at 3:05 PM, Ammar Ibrahim wrote: Thanks that fixed it! Although when you call it directly from the command line, it's fine to have the space there! I'd argue that f

Re: NSTask & curl

2009-06-06 Thread Michael Ash
On Sat, Jun 6, 2009 at 6:05 PM, Ammar Ibrahim wrote: > On Sun, Jun 7, 2009 at 12:29 AM, Andrew Farmer wrote: > >> On 6 Jun 2009, at 14:18, Ammar Ibrahim wrote: >> >>> I'm using NSTask to spawn a process to do some work as per the code below: >>> >>>   >> >>> [task setLaunchPath:@"/usr/bin/curl"];

Re: NSTask & curl

2009-06-06 Thread Wim Lewis
On Jun 6, 2009, at 3:09 PM, Bill Bumgarner wrote: What others haven't mentioned is that it is also a potential security hole or source of confusion for your users. Namely, packing up command lines and then executing sub shells is rife with fragility and security issues. He's not executin

Re: NSTask & curl

2009-06-06 Thread Ammar Ibrahim
On Sun, Jun 7, 2009 at 1:09 AM, Bill Bumgarner wrote: > On Jun 6, 2009, at 3:05 PM, Ammar Ibrahim wrote: > >> Thanks that fixed it! Although when you call it directly from the command >> line, it's fine to have the space there! >> > > I'd argue that fixed a symptom, but not the problem. > > As ot

Re: NSTask & curl

2009-06-06 Thread Bill Bumgarner
On Jun 6, 2009, at 3:05 PM, Ammar Ibrahim wrote: Thanks that fixed it! Although when you call it directly from the command line, it's fine to have the space there! I'd argue that fixed a symptom, but not the problem. As others have said, launching a task to execute curl is just about as wa

Re: NSTask & curl

2009-06-06 Thread Ammar Ibrahim
On Sun, Jun 7, 2009 at 12:29 AM, Nick Zitzmann wrote: > > On Jun 6, 2009, at 3:18 PM, Ammar Ibrahim wrote: > > The problem is that in my delegate I can't access the file! Although I can >> see it on the filesystem and open it. even if I check if the file exists >> from the delegate, it gives me

Re: NSTask & curl

2009-06-06 Thread Ammar Ibrahim
On Sun, Jun 7, 2009 at 12:29 AM, Andrew Farmer wrote: > On 6 Jun 2009, at 14:18, Ammar Ibrahim wrote: > >> I'm using NSTask to spawn a process to do some work as per the code below: >> >> > >> [task setLaunchPath:@"/usr/bin/curl"]; >> > > Why on earth are you shelling out to do that? NSURLDownl

Re: NSTask & curl

2009-06-06 Thread Nick Zitzmann
On Jun 6, 2009, at 3:18 PM, Ammar Ibrahim wrote: The problem is that in my delegate I can't access the file! Although I can see it on the filesystem and open it. even if I check if the file exists from the delegate, it gives me "false". Why is this happening? How can I fix it Well, let

Re: NSTask & curl

2009-06-06 Thread Andrew Farmer
On 6 Jun 2009, at 14:18, Ammar Ibrahim wrote: I'm using NSTask to spawn a process to do some work as per the code below: [task setLaunchPath:@"/usr/bin/curl"]; Why on earth are you shelling out to do that? NSURLDownload exists for a reason. In any case, the reason you aren't ending up

NSTask & curl

2009-06-06 Thread Ammar Ibrahim
I'm using NSTask to spawn a process to do some work as per the code below: -(void)downloadFile:(NSString *)downloadURL { mode = @"download"; downloadFilePath = [self generateUniqueTemporaryFileName]; task = [[NSTask init] alloc]; [task setLaunchPath:@"/usr/bin/curl"]; [task setArguments