In support of #8305 (implement cache).
Add Truncate() method to nsIFileSpec and implement in nsFileSpecImpl [Mac Implementation: sdagley, r: sfraser] [Win implementation: fur, r:rogerl] [Unix implementation: yixiong.zue@intel.com, r: fur]
This commit is contained in:
@@ -341,6 +341,22 @@ void nsFileSpec::RecursiveCopy(nsFileSpec newDir) const
|
||||
} // nsFileSpec::RecursiveCopy
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsresult nsFileSpec::Truncate(const 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)
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user