Clone nsFileSpec::Truncate from nsFileSpecUnix.cpp, r=shaver.

git-svn-id: svn://10.0.0.236/trunk@54070 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
duncan%be.com 1999-11-20 17:57:42 +00:00
parent 561be072fd
commit ea96df6f46

View File

@ -286,6 +286,22 @@ void nsFileSpec::RecursiveCopy(nsFileSpec newDir) const
}
} // nsFileSpec::RecursiveCopy
//----------------------------------------------------------------------------------------
nsresult nsFileSpec::Truncate(PRInt32 offset) const
//----------------------------------------------------------------------------------------
{
char* Path = nsCRT::strdup(mPath);
int rv = truncate(Path, offset) ;
nsCRT::free(Path) ;
if(!rv)
return NS_OK ;
else
return NS_ERROR_FAILURE ;
} // nsFileSpec::Truncate
//----------------------------------------------------------------------------------------
nsresult nsFileSpec::Rename(const char* inNewName)
//----------------------------------------------------------------------------------------