Make the windows specific code use nsprPath.
git-svn-id: svn://10.0.0.236/trunk@26905 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
88b4363d0e
commit
4ed02c79b9
@ -177,7 +177,7 @@ PRBool nsFileSpec::Exists() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st);
|
||||
return 0 == stat(nsprPath(*this), &st);
|
||||
} // nsFileSpec::Exists
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -185,7 +185,7 @@ void nsFileSpec::GetModDate(TimeStamp& outStamp) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
if (stat(mPath, &st) == 0)
|
||||
if (stat(nsprPath(*this), &st) == 0)
|
||||
outStamp = st.st_mtime;
|
||||
else
|
||||
outStamp = 0;
|
||||
@ -196,7 +196,7 @@ PRUint32 nsFileSpec::GetFileSize() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
if (stat(mPath, &st) == 0)
|
||||
if (stat(nsprPath(*this), &st) == 0)
|
||||
return (PRUint32)st.st_size;
|
||||
return 0;
|
||||
} // nsFileSpec::GetFileSize
|
||||
@ -206,7 +206,7 @@ PRBool nsFileSpec::IsFile() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st) && (_S_IFREG & st.st_mode);
|
||||
return 0 == stat(nsprPath(*this), &st) && (_S_IFREG & st.st_mode);
|
||||
} // nsFileSpec::IsFile
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -214,7 +214,7 @@ PRBool nsFileSpec::IsDirectory() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st) && (_S_IFDIR & st.st_mode);
|
||||
return 0 == stat(nsprPath(*this), &st) && (_S_IFDIR & st.st_mode);
|
||||
} // nsFileSpec::IsDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -250,7 +250,7 @@ void nsFileSpec::CreateDirectory(int /*mode*/)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Note that mPath is canonical!
|
||||
mkdir(mPath);
|
||||
mkdir(nsprPath(*this));
|
||||
} // nsFileSpec::CreateDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -267,11 +267,11 @@ void nsFileSpec::Delete(PRBool inRecursive) const
|
||||
child.Delete(inRecursive);
|
||||
}
|
||||
}
|
||||
rmdir(mPath);
|
||||
rmdir(nsprPath(*this));
|
||||
}
|
||||
else
|
||||
{
|
||||
remove(mPath);
|
||||
remove(nsprPath(*this));
|
||||
}
|
||||
} // nsFileSpec::Delete
|
||||
|
||||
|
||||
@ -177,7 +177,7 @@ PRBool nsFileSpec::Exists() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st);
|
||||
return 0 == stat(nsprPath(*this), &st);
|
||||
} // nsFileSpec::Exists
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -185,7 +185,7 @@ void nsFileSpec::GetModDate(TimeStamp& outStamp) const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
if (stat(mPath, &st) == 0)
|
||||
if (stat(nsprPath(*this), &st) == 0)
|
||||
outStamp = st.st_mtime;
|
||||
else
|
||||
outStamp = 0;
|
||||
@ -196,7 +196,7 @@ PRUint32 nsFileSpec::GetFileSize() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
if (stat(mPath, &st) == 0)
|
||||
if (stat(nsprPath(*this), &st) == 0)
|
||||
return (PRUint32)st.st_size;
|
||||
return 0;
|
||||
} // nsFileSpec::GetFileSize
|
||||
@ -206,7 +206,7 @@ PRBool nsFileSpec::IsFile() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st) && (_S_IFREG & st.st_mode);
|
||||
return 0 == stat(nsprPath(*this), &st) && (_S_IFREG & st.st_mode);
|
||||
} // nsFileSpec::IsFile
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -214,7 +214,7 @@ PRBool nsFileSpec::IsDirectory() const
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
struct stat st;
|
||||
return 0 == stat(mPath, &st) && (_S_IFDIR & st.st_mode);
|
||||
return 0 == stat(nsprPath(*this), &st) && (_S_IFDIR & st.st_mode);
|
||||
} // nsFileSpec::IsDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -250,7 +250,7 @@ void nsFileSpec::CreateDirectory(int /*mode*/)
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
// Note that mPath is canonical!
|
||||
mkdir(mPath);
|
||||
mkdir(nsprPath(*this));
|
||||
} // nsFileSpec::CreateDirectory
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@ -267,11 +267,11 @@ void nsFileSpec::Delete(PRBool inRecursive) const
|
||||
child.Delete(inRecursive);
|
||||
}
|
||||
}
|
||||
rmdir(mPath);
|
||||
rmdir(nsprPath(*this));
|
||||
}
|
||||
else
|
||||
{
|
||||
remove(mPath);
|
||||
remove(nsprPath(*this));
|
||||
}
|
||||
} // nsFileSpec::Delete
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user