Make the windows specific code use nsprPath.

This commit is contained in:
dougt%netscape.com 1999-04-10 00:30:23 +00:00
parent a248eade5c
commit 76fb8170a9
2 changed files with 16 additions and 16 deletions

View File

@ -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

View File

@ -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