return (path != other.path);
}
+bool SGPath::rename(const SGPath& newName)
+{
+ if (::rename(c_str(), newName.c_str()) != 0) {
+ SG_LOG(SG_IO, SG_WARN, "renamed failed: from " << str() << " to " << newName.str()
+ << " reason: " << strerror(errno));
+ return false;
+ }
+
+ path = newName.path;
+ _cached = false;
+ return true;
+}
+
* modification time of the file
*/
time_t modTime() const;
+
+ /**
+ * rename the file / directory we point at, to a new name
+ * this may fail if the new location is on a different volume / share,
+ * or if the destination already exists, or is not writeable
+ */
+ bool rename(const SGPath& newName);
private:
void fix();