dirPath += srcSpec.GetLeafName();
char* leafName = srcSpec.GetLeafName(); dirPath += leafName; nsCRT::free(leafName);
int FilesTest::Move(const char* file, const char* dir)//----------------------------------------------------------------------------------------{    nsFileSpec dirPath(dir, PR_TRUE);            dirPath.CreateDirectory();    if (! dirPath.Exists())        return Failed();        nsFileSpec srcSpec(file, PR_TRUE); // relative path.    {       nsIOFileStream testStream(srcSpec); // creates the file       // file gets closed here because scope ends here.    };        if (! srcSpec.Exists())        return Failed();       nsresult error = srcSpec.Move(dirPath);    dirPath += srcSpec.GetLeafName();    if (! dirPath.Exists() || ! srcSpec.Exists() || NS_FAILED(error))        return Failed();    return Passed();}