nsresult rv = nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, NULL, NS_GET_IID(nsILocalFile), (void**)getter_AddRefs(file));
nsresult rv; nsCOMPtr<nsILocalFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
CopyTest(const char *testFile, const char *targetDir){  nsCOMPtr<nsILocalFile> file;  nsCOMPtr<nsILocalFile> dir;  printf("start copy test\n");  nsresult rv =    nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, NULL,				       NS_GET_IID(nsILocalFile), 				       (void**)getter_AddRefs(file));      if (NS_FAILED(rv) || (!file))   {    printf("create nsILocalFile failed\n");    return;  }  rv = file->InitWithNativePath(nsDependentCString(testFile));  VerifyResult(rv);    rv = nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, NULL,					  NS_GET_IID(nsILocalFile), 					  (void**)getter_AddRefs(dir));  if (NS_FAILED(rv) || (!dir))   {    printf("create nsILocalFile failed\n");    return;  }  rv = dir->InitWithNativePath(nsDependentCString(targetDir));  VerifyResult(rv);  rv = file->CopyTo(dir, EmptyString());  VerifyResult(rv);  printf("end copy test\n");}