nsresult rv = directory->InitWithNativePath(nsDependentCString(argv[2]));
if (NS_FAILED(directory->InitWithNativePath(nsDependentCString(argv[2])))) { fprintf(stderr, "InitWithNativePath failed\n"); return -2; }
main(int argc, char **argv){  nsString url_address;  if (argc != 3) {    fprintf(stderr, "Usage: grabpage url directory\n");    return -1;  }  PageGrabber* grabber = new PageGrabber();  if(grabber) {    nsCOMPtr <nsILocalFile> directory(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID));;    nsresult rv = directory->InitWithNativePath(nsDependentCString(argv[2]));    grabber->Init(directory);    if (NS_OK != grabber->Grab(nsDependentCString(argv[1]))) {      return -1;    }  }  return 0;}