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:
parent
561be072fd
commit
ea96df6f46
@ -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)
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user