*** empty log message ***

This commit is contained in:
David Rose 2000-11-11 04:34:04 +00:00
parent 971f547694
commit 768fdab67a
2 changed files with 57 additions and 0 deletions

View File

@ -581,6 +581,61 @@ exists() const {
return exists;
}
////////////////////////////////////////////////////////////////////
// Function: Filename::is_regular_file
// Access: Public
// Description: Returns true if the filename exists and is the
// name of a regular file (i.e. not a directory or
// device), false otherwise.
////////////////////////////////////////////////////////////////////
bool Filename::
is_regular_file() const {
#ifdef WIN32_VC
struct _stat this_buf;
bool isdir = false;
if (_stat(to_os_specific().c_str(), &this_buf) == 0) {
isdir = S_ISREG(this_buf.st_mode);
}
#else // WIN32_VC
struct stat this_buf;
bool isdir = false;
if (stat(to_os_specific().c_str(), &this_buf) == 0) {
isdir = S_ISREG(this_buf.st_mode);
}
#endif
return isdir;
}
////////////////////////////////////////////////////////////////////
// Function: Filename::is_directory
// Access: Public
// Description: Returns true if the filename exists and is a
// directory name, false otherwise.
////////////////////////////////////////////////////////////////////
bool Filename::
is_directory() const {
#ifdef WIN32_VC
struct _stat this_buf;
bool isdir = false;
if (_stat(to_os_specific().c_str(), &this_buf) == 0) {
isdir = S_ISDIR(this_buf.st_mode);
}
#else // WIN32_VC
struct stat this_buf;
bool isdir = false;
if (stat(to_os_specific().c_str(), &this_buf) == 0) {
isdir = S_ISDIR(this_buf.st_mode);
}
#endif
return isdir;
}
////////////////////////////////////////////////////////////////////
// Function: Filename::compare_timestamps
// Access: Public

View File

@ -122,6 +122,8 @@ public:
string to_os_specific() const;
bool exists() const;
bool is_regular_file() const;
bool is_directory() const;
int compare_timestamps(const Filename &other,
bool this_missing_is_old = true,
bool other_missing_is_old = true) const;