mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
*** empty log message ***
This commit is contained in:
parent
971f547694
commit
768fdab67a
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user