dirEntry->GetLeafName(leafName); newChild->AppendRelativePath(leafName);
dirEntry->GetNativeLeafName(leafName); newChild->AppendRelativeNativePath(leafName);
nsresult RecursiveCopy(nsIFile* srcDir, nsIFile* destDir){    nsresult rv;    PRBool isDir;        rv = srcDir->IsDirectory(&isDir);    if (NS_FAILED(rv)) return rv;	if (!isDir) return NS_ERROR_INVALID_ARG;    PRBool exists;    rv = destDir->Exists(&exists);	if (NS_SUCCEEDED(rv) && !exists)		rv = destDir->Create(nsIFile::DIRECTORY_TYPE, 0775);	if (NS_FAILED(rv)) return rv;    PRBool hasMore = PR_FALSE;    nsCOMPtr<nsISimpleEnumerator> dirIterator;    rv = srcDir->GetDirectoryEntries(getter_AddRefs(dirIterator));    if (NS_FAILED(rv)) return rv;        rv = dirIterator->HasMoreElements(&hasMore);    if (NS_FAILED(rv)) return rv;        nsCOMPtr<nsIFile> dirEntry;    	while (hasMore)	{		rv = dirIterator->GetNext((nsISupports**)getter_AddRefs(dirEntry));		if (NS_SUCCEEDED(rv))		{		    rv = dirEntry->IsDirectory(&isDir);		    if (NS_SUCCEEDED(rv))		    {		        if (isDir)		        {		            nsCOMPtr<nsIFile> destClone;		            rv = destDir->Clone(getter_AddRefs(destClone));		            if (NS_SUCCEEDED(rv))		            {		                nsCOMPtr<nsILocalFile> newChild(do_QueryInterface(destClone));		                nsCAutoString leafName;		                dirEntry->GetLeafName(leafName);		                newChild->AppendRelativePath(leafName);		                rv = RecursiveCopy(dirEntry, newChild);		            }		        }		        else		            rv = dirEntry->CopyTo(destDir, nsCString());		    }				}        rv = dirIterator->HasMoreElements(&hasMore);        if (NS_FAILED(rv)) return rv;	}	return rv;}