title: Catch credential needed with NSTask and rsync
body: <p>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 : </p>
  
  <pre><code>NSTask *task = [[NSTask alloc] init];
  [task setLaunchPath:@"/usr/bin/rsync"];
  NSArray* args = [NSArray arrayWithObjects:@"-av", @"/Users/BiB1/Documents/test/", @"login@ftp.myserver.net:~/test/", nil];
  NSDictionary* env = [NSDictionary dictionaryWithObject:&lt;#(id)object#&gt; forKey:&lt;#(id)key#&gt;
  [task setArguments:args];
  NSPipe *outPipe = [[NSPipe alloc] init];
  [task setStandardOutput:outPipe];
  [outPipe release];
  [task launch];
  
  NSData *data = [[outPipe fileHandleForReading] readDataToEndOfFile];
  [task waitUntilExit];
  
  int status = [task terminationStatus];
  [task release];
  if(status != 0)
  {
      NSDictionary *eDict = [NSDictionary dictionaryWithObject:@"Sync impossible" forKey:NSOSStatusErrorDomain];
      NSError *outError   = [NSError errorWithDomain:NSOSStatusErrorDomain code:0 userInfo:eDict];
  
      NSLog(@"EDICT : %@",eDict);
      NSLog(@"ERROR : %@",outError);
  }
  
  NSString *aString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  [self.textField setStringValue:aString];
  
  [aString release];
  </code></pre>
  
  <p>In the terminal the command work fine but I have a request for the password. And in NSTask I don't have this request.</p>
  
  <p>So my question is, there is a method for catching crendential needed, or is it possible to set password as parameter or something else.</p>
  
  <p>Thanks by advance.</p>
  
  <p>BiB1  </p>