1 //  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2 //  This source code is licensed under both the GPLv2 (found in the
3 //  COPYING file in the root directory) and Apache 2.0 License
4 //  (found in the LICENSE.Apache file in the root directory).
5 //
6 #pragma once
7 #include <string>
8 
9 #include "file/filename.h"
10 #include "options/db_options.h"
11 #include "rocksdb/env.h"
12 #include "rocksdb/file_system.h"
13 #include "rocksdb/status.h"
14 #include "rocksdb/types.h"
15 
16 namespace ROCKSDB_NAMESPACE {
17 // use_fsync maps to options.use_fsync, which determines the way that
18 // the file is synced after copying.
19 extern Status CopyFile(FileSystem* fs, const std::string& source,
20                        const std::string& destination, uint64_t size,
21                        bool use_fsync);
22 
23 extern Status CreateFile(FileSystem* fs, const std::string& destination,
24                          const std::string& contents, bool use_fsync);
25 
26 extern Status DeleteDBFile(const ImmutableDBOptions* db_options,
27                            const std::string& fname,
28                            const std::string& path_to_sync, const bool force_bg,
29                            const bool force_fg);
30 
31 extern bool IsWalDirSameAsDBPath(const ImmutableDBOptions* db_options);
32 
33 }  // namespace ROCKSDB_NAMESPACE
34