Added ReaderWriter::fileExists() method to help enable querrying of existing of files on servers using the curl plugin

This commit is contained in:
Robert Osfield
2009-05-13 19:46:16 +00:00
parent 078fe9e84c
commit 122ee0a001
3 changed files with 14 additions and 1 deletions

View File

@@ -117,3 +117,12 @@ ReaderWriter::FeatureList ReaderWriter::featureAsString(ReaderWriter::Features f
}
return result;
}
bool ReaderWriter::fileExists(const std::string& filename, const Options* /*options*/) const
{
#ifdef OSG_USE_UTF8_FILENAME
return _waccess( OSGDB_STRING_TO_FILENAME(filename).c_str(), F_OK ) == 0;
#else
return access( filename.c_str(), F_OK ) == 0;
#endif
}