summaryrefslogtreecommitdiff
path: root/examples/optimistic_transaction_example.cc
diff options
context:
space:
mode:
authorTomasz Posłuszny <tefposluszny@gmail.com>2020-09-01 18:02:25 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2020-09-01 18:03:50 -0700
commit8d44d792c30363a56bc96d24a5ec82c95474f243 (patch)
tree8d39744f044fafc1b595f4eaf82a069d898afcda /examples/optimistic_transaction_example.cc
parent55bf42a80c5a0d7cc85d742d80dd0a254e2321b6 (diff)
Make examples work on Windows (#7304)
Summary: Quick fixes to examples to make it easier to get familiar with RocksDB for Windows users: - Set proper temporary directory path on Windows for all examples (with C++17 we should start using std::filesystem) - Fixed typo and got rid of warnings treated as errors in multi_processes_example.cc - Get number of available cores on Windows in c_simple_example.c - Add command to remove DB directory for Windows in compaction_filter_example.cc (print error, but carry on with example upon error, because error code is returned if there is no such directory on Windows) Pull Request resolved: https://github.com/facebook/rocksdb/pull/7304 Reviewed By: jay-zhuang Differential Revision: D23450900 Pulled By: pdillinger fbshipit-source-id: 4256134deb6ae6bb267ed1bd69f814842b95f60f
Diffstat (limited to 'examples/optimistic_transaction_example.cc')
-rw-r--r--examples/optimistic_transaction_example.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/optimistic_transaction_example.cc b/examples/optimistic_transaction_example.cc
index fd6dbad63..e398ad05e 100644
--- a/examples/optimistic_transaction_example.cc
+++ b/examples/optimistic_transaction_example.cc
@@ -13,7 +13,11 @@
using namespace ROCKSDB_NAMESPACE;
+#if defined(OS_WIN)
+std::string kDBPath = "C:\\Windows\\TEMP\\rocksdb_transaction_example";
+#else
std::string kDBPath = "/tmp/rocksdb_transaction_example";
+#endif
int main() {
// open DB