nsCOMPtr<nsILocalFile> file; nsresult rv = nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID, nsnull, NS_GET_IID(nsILocalFile), (void **)getter_AddRefs(file));
nsresult rv; nsCOMPtr<nsILocalFile> file = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
void CreationTest(const char* creationPath, const char* appendPath,		  PRInt32 whatToCreate, PRInt32 perm){    nsCOMPtr<nsILocalFile> file;    nsresult rv =     nsComponentManager::CreateInstance(NS_LOCAL_FILE_CONTRACTID,                                               nsnull,                                               NS_GET_IID(nsILocalFile),                                               (void **)getter_AddRefs(file));    if (NS_FAILED(rv) || (!file))     {        printf("create nsILocalFile failed\n");        return;    }    Banner("Creation Test");    printf("creationPath == %s\nappendPath == %s\n", creationPath, appendPath);    rv = file->InitWithNativePath(nsDependentCString(creationPath));    VerifyResult(rv);     printf("Appending %s\n", appendPath);    rv = file->AppendRelativeNativePath(nsDependentCString(appendPath));    VerifyResult(rv);        printf("Check For Existence\n");    PRBool exists;    file->Exists(&exists);    if (exists)        printf("Yup!\n");    else        printf("no.\n");    rv = file->Create(whatToCreate, perm);      VerifyResult(rv);    rv = file->Exists(&exists);    VerifyResult(rv);        if (!exists)    {        Failed("Did not create file system object!");        return;    }    }    