mParent->Clone(getter_AddRefs(file));
rv = mParent->Clone(getter_AddRefs(file)); if (NS_FAILED(rv)) return rv;
        NS_IMETHOD HasMoreElements(PRBool *result)         {            nsresult rv;            if (mNext == nsnull && mDir)             {                PRDirEntry* entry = PR_ReadDir(mDir, PR_SKIP_BOTH);                if (entry == nsnull)                 {                    // end of dir entries                    PRStatus status = PR_CloseDir(mDir);                    if (status != PR_SUCCESS)                        return NS_ERROR_FAILURE;                    mDir = nsnull;                    *result = PR_FALSE;                    return NS_OK;                }                nsCOMPtr<nsIFile> file;                mParent->Clone(getter_AddRefs(file));                rv = file->Append(entry->name);                if (NS_FAILED(rv))                     return rv;                                // make sure the thing exists.  If it does, try the next one.                PRBool exists;                rv = file->Exists(&exists);                if (NS_FAILED(rv) || !exists)                 {                    return HasMoreElements(result);                 }                                mNext = do_QueryInterface(file);            }            *result = mNext != nsnull;            return NS_OK;        }