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:
fur@netscape.com
1999-11-19 01:42:46 +00:00
parent 3f47605ae0
commit 40efdbc477
6 changed files with 93 additions and 2 deletions
+16
View File
@@ -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)
//----------------------------------------------------------------------------------------