Added GetModDate and GetFileSize. Fixed a crash with a strcmp of null.
git-svn-id: svn://10.0.0.236/trunk@23564 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -98,6 +98,27 @@ PRBool nsFileSpec::Exists() const
|
||||
return 0 == stat(mPath, &st);
|
||||
} // nsFileSpec::Exists
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsFileSpec::GetModDate(TimeStamp& outStamp) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
if (stat(mPath, &st) == 0)
|
||||
outStamp = st.st_mtime;
|
||||
else
|
||||
outStamp = 0;
|
||||
} // nsFileSpec::GetModDate
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRUint32 nsFileSpec::GetFileSize() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
if (stat(mPath, &st) == 0)
|
||||
return (PRUint32)st.st_size;
|
||||
return 0;
|
||||
} // nsFileSpec::GetFileSize
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
PRBool nsFileSpec::IsFile() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user