Make sure code compiles on Ubuntu 12.04 with boost 1.46
Work with permissions in boost::filesystem was introduced in boost 1.49
diff --git a/src/state-server.cc b/src/state-server.cc
index f0616b0..2d1d96a 100644
--- a/src/state-server.cc
+++ b/src/state-server.cc
@@ -463,7 +463,9 @@
{
if (filesystem::exists (filePath) &&
filesystem::last_write_time (filePath) == file->mtime () &&
+#if BOOST_VERSION >= 104900
filesystem::status (filePath).permissions () == static_cast<filesystem::perms> (file->mode ()) &&
+#endif
*Hash::FromFileContent (filePath) == hash)
{
m_ccnx->publishData (interest, "OK: File already exists", 1);
@@ -481,7 +483,9 @@
if (m_objectManager.objectsToLocalFile (deviceName, hash, filePath))
{
last_write_time (filePath, file->mtime ());
+#if BOOST_VERSION >= 104900
permissions (filePath, static_cast<filesystem::perms> (file->mode ()));
+#endif
m_ccnx->publishData (interest, "OK", 1);
}
else