| Attached Files | cache.diff [^] (1,443 bytes) 2012-02-07 16:45 [Show Content] [Hide Content]diff -r f2f4cc72ac65 console/luxconsole.cpp
--- a/console/luxconsole.cpp Tue Feb 07 03:40:06 2012 +0100
+++ b/console/luxconsole.cpp Tue Feb 07 17:43:58 2012 -0700
@@ -131,6 +131,7 @@
("serverinterval,i", po::value < int >(), "Specify the number of seconds between requests to rendering servers.")
("serverport,p", po::value < int >(), "Specify the tcp port used in server mode.")
("serverwriteflm,W", "Write film to disk before transmitting in server mode.")
+ ("cachedir,c", po::value< std::string >(), "Specify the cache directory to use")
;
// Hidden options, will be allowed both on command line and
@@ -348,6 +349,23 @@
}
} else if (vm.count("server")) {
bool writeFlmFile = vm.count("serverwriteflm") != 0;
+
+ std::string cachedir;
+ if (vm.count("cachedir")) {
+ cachedir = vm["cachedir"].as<std::string>();
+ boost::filesystem::path cachePath(cachedir);
+ try {
+ if (!boost::filesystem::is_directory(cachePath))
+ boost::filesystem::create_directory(cachePath);
+
+ boost::filesystem::current_path(cachePath);
+ } catch (std::exception &e) {
+ LOG(LUX_SEVERE,LUX_NOFILE) << "Unable to use cache directory '" << cachedir << "': " << e.what();
+ return 1;
+ }
+ LOG(LUX_INFO,LUX_NOERROR) << "Using cache directory '" << cachedir << "'";
+ }
+
renderServer = new RenderServer(threads, serverPort, writeFlmFile);
prevErrorHandler = luxError;
|