switch experimental::fs to std::fs
std::filesystem was added to C++17 and is well supported now. Remove
the older std::experimental::filesystem usage.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6d1ef0f3ac02954ddbffc332393fa11930dffad7
diff --git a/vpnor/Makefile.am.include b/vpnor/Makefile.am.include
index a37d1ff..336ea90 100644
--- a/vpnor/Makefile.am.include
+++ b/vpnor/Makefile.am.include
@@ -2,7 +2,7 @@
%reldir%/backend.cpp \
%reldir%/partition.cpp
-mboxd_LDFLAGS += -lstdc++fs \
+mboxd_LDFLAGS += \
$(SDBUSPLUS_LIBS) \
$(PHOSPHOR_LOGGING_LIBS) \
$(PHOSPHOR_DBUS_INTERFACES_LIBS)
diff --git a/vpnor/backend.cpp b/vpnor/backend.cpp
index 43591db..b155cf3 100644
--- a/vpnor/backend.cpp
+++ b/vpnor/backend.cpp
@@ -28,7 +28,7 @@
#include <cassert>
#include <exception>
-#include <experimental/filesystem>
+#include <filesystem>
#include <memory>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
@@ -38,7 +38,7 @@
#include "vpnor/backend.h"
namespace err = sdbusplus::xyz::openbmc_project::Common::Error;
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
namespace vpnor = openpower::virtual_pnor;
static constexpr uint32_t VPNOR_ERASE_SIZE = 4 * 1024;
@@ -73,7 +73,7 @@
const vpnor_partition_paths* paths)
{
namespace err = sdbusplus::xyz::openbmc_project::Common::Error;
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace vpnor = openpower::virtual_pnor;
vpnor_data* priv = new vpnor_data;
@@ -130,7 +130,7 @@
constexpr auto blPartitionName = "HBB";
namespace err = sdbusplus::xyz::openbmc_project::Common::Error;
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace vpnor = openpower::virtual_pnor;
try
diff --git a/vpnor/partition.cpp b/vpnor/partition.cpp
index 4595387..d54a761 100644
--- a/vpnor/partition.cpp
+++ b/vpnor/partition.cpp
@@ -35,7 +35,7 @@
namespace virtual_pnor
{
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
fs::path Request::getPartitionFilePath(int flags)
{
@@ -98,7 +98,7 @@
dst /= partition.data.name;
fs::copy_file(src, dst);
- fs::permissions(dst, fs::perms::add_perms | fs::perms::owner_write);
+ fs::permissions(dst, fs::perms::owner_write, fs::perm_options::add);
return dst;
}
diff --git a/vpnor/partition.hpp b/vpnor/partition.hpp
index 6b6d46b..e74dd35 100644
--- a/vpnor/partition.hpp
+++ b/vpnor/partition.hpp
@@ -12,7 +12,7 @@
#include <fcntl.h>
#include <unistd.h>
-#include <experimental/filesystem>
+#include <filesystem>
#include <string>
namespace openpower
@@ -20,7 +20,7 @@
namespace virtual_pnor
{
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
class Request
{
@@ -88,7 +88,7 @@
*
* Throws: std::filesystem_error, std::bad_alloc
*/
- std::experimental::filesystem::path getPartitionFilePath(int flags);
+ std::filesystem::path getPartitionFilePath(int flags);
struct backend* backend;
const pnor_partition& partition;
diff --git a/vpnor/table.hpp b/vpnor/table.hpp
index e42e8d8..68c82be 100644
--- a/vpnor/table.hpp
+++ b/vpnor/table.hpp
@@ -3,7 +3,7 @@
#pragma once
#include <cstring>
-#include <experimental/filesystem>
+#include <filesystem>
#include <memory>
#include <numeric>
#include <vector>
@@ -22,7 +22,7 @@
namespace virtual_pnor
{
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
using PartitionTable = std::vector<uint8_t>;
using checksum_t = uint32_t;
diff --git a/vpnor/test/Makefile.am.include b/vpnor/test/Makefile.am.include
index 71a1517..dbbf3fc 100644
--- a/vpnor/test/Makefile.am.include
+++ b/vpnor/test/Makefile.am.include
@@ -11,7 +11,7 @@
vpnor/table.cpp \
%reldir%/tmpd.cpp
-VPNOR_LDADD = -lstdc++fs \
+VPNOR_LDADD = \
$(SDBUSPLUS_LIBS) \
$(PHOSPHOR_LOGGING_LIBS) \
$(PHOSPHOR_DBUS_INTERFACES_LIBS)
diff --git a/vpnor/test/create_aligned_window.cpp b/vpnor/test/create_aligned_window.cpp
index 910e7c5..82f035d 100644
--- a/vpnor/test/create_aligned_window.cpp
+++ b/vpnor/test/create_aligned_window.cpp
@@ -12,7 +12,7 @@
#include <cassert>
#include <cstring>
-#include <experimental/filesystem>
+#include <filesystem>
#include <fstream>
#include <vector>
diff --git a/vpnor/test/create_read_window_partition_exists.cpp b/vpnor/test/create_read_window_partition_exists.cpp
index 5469615..b32e2d8 100644
--- a/vpnor/test/create_read_window_partition_exists.cpp
+++ b/vpnor/test/create_read_window_partition_exists.cpp
@@ -12,7 +12,7 @@
#include <cassert>
#include <cstring>
-#include <experimental/filesystem>
+#include <filesystem>
#include <fstream>
#include <vector>
diff --git a/vpnor/test/create_read_window_remap.cpp b/vpnor/test/create_read_window_remap.cpp
index 5e25412..2f27be1 100644
--- a/vpnor/test/create_read_window_remap.cpp
+++ b/vpnor/test/create_read_window_remap.cpp
@@ -12,7 +12,7 @@
#include <cassert>
#include <cstring>
-#include <experimental/filesystem>
+#include <filesystem>
#include <fstream>
#include <vector>
diff --git a/vpnor/test/create_read_window_size.cpp b/vpnor/test/create_read_window_size.cpp
index 17240c9..f12a6c8 100644
--- a/vpnor/test/create_read_window_size.cpp
+++ b/vpnor/test/create_read_window_size.cpp
@@ -11,7 +11,7 @@
#include "vpnor/test/tmpd.hpp"
#include <cassert>
-#include <experimental/filesystem>
+#include <filesystem>
#include "vpnor/backend.h"
diff --git a/vpnor/test/create_read_window_straddle_partitions.cpp b/vpnor/test/create_read_window_straddle_partitions.cpp
index 7b09ff6..f71acf8 100644
--- a/vpnor/test/create_read_window_straddle_partitions.cpp
+++ b/vpnor/test/create_read_window_straddle_partitions.cpp
@@ -45,7 +45,7 @@
int main()
{
namespace test = openpower::virtual_pnor::test;
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
struct mbox_context* ctx;
diff --git a/vpnor/test/tmpd.cpp b/vpnor/test/tmpd.cpp
index 917fb71..699c659 100644
--- a/vpnor/test/tmpd.cpp
+++ b/vpnor/test/tmpd.cpp
@@ -10,7 +10,7 @@
namespace test
{
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
size_t VpnorRoot::write(const std::string& name, const void* data, size_t len)
{
diff --git a/vpnor/test/tmpd.hpp b/vpnor/test/tmpd.hpp
index ae6da9e..38fb428 100644
--- a/vpnor/test/tmpd.hpp
+++ b/vpnor/test/tmpd.hpp
@@ -12,7 +12,7 @@
#include <cassert>
#include <cstring>
-#include <experimental/filesystem>
+#include <filesystem>
#include <fstream>
#include <vector>
@@ -23,7 +23,7 @@
namespace test
{
-namespace fs = std::experimental::filesystem;
+namespace fs = std::filesystem;
class VpnorRoot
{
diff --git a/vpnor/test/toc_missing_file.cpp b/vpnor/test/toc_missing_file.cpp
index 2face11..d573fe1 100644
--- a/vpnor/test/toc_missing_file.cpp
+++ b/vpnor/test/toc_missing_file.cpp
@@ -29,7 +29,7 @@
int main()
{
namespace test = openpower::virtual_pnor::test;
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace vpnor = openpower::virtual_pnor;
struct mbox_context* ctx;
diff --git a/vpnor/test/write_patch.cpp b/vpnor/test/write_patch.cpp
index 4a200c0..49d1d1a 100644
--- a/vpnor/test/write_patch.cpp
+++ b/vpnor/test/write_patch.cpp
@@ -18,7 +18,7 @@
#include <unistd.h>
#include <cassert>
-#include <experimental/filesystem>
+#include <filesystem>
static constexpr auto BLOCK_SIZE = 0x1000;
static constexpr auto DATA_SIZE = 8;
@@ -32,7 +32,7 @@
int main(void)
{
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace test = openpower::virtual_pnor::test;
struct mbox_context _ctx, *ctx = &_ctx;
diff --git a/vpnor/test/write_patch_resize.cpp b/vpnor/test/write_patch_resize.cpp
index 38effd6..56d7423 100644
--- a/vpnor/test/write_patch_resize.cpp
+++ b/vpnor/test/write_patch_resize.cpp
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <cassert>
-#include <experimental/filesystem>
+#include <filesystem>
static constexpr auto BLOCK_SIZE = 0x1000;
static constexpr auto PART_SIZE = BLOCK_SIZE;
@@ -32,7 +32,7 @@
int main(void)
{
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace test = openpower::virtual_pnor::test;
struct mbox_context _ctx, *ctx = &_ctx;
diff --git a/vpnor/test/write_prsv.cpp b/vpnor/test/write_prsv.cpp
index 134a98e..d959329 100644
--- a/vpnor/test/write_prsv.cpp
+++ b/vpnor/test/write_prsv.cpp
@@ -27,7 +27,7 @@
int main(void)
{
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
struct mbox_context _ctx, *ctx = &_ctx;
uint8_t src[8];
diff --git a/vpnor/test/write_ro.cpp b/vpnor/test/write_ro.cpp
index 5965ebf..b125236 100644
--- a/vpnor/test/write_ro.cpp
+++ b/vpnor/test/write_ro.cpp
@@ -26,7 +26,7 @@
int main(void)
{
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace test = openpower::virtual_pnor::test;
struct mbox_context _ctx, *ctx = &_ctx;
diff --git a/vpnor/test/write_rw.cpp b/vpnor/test/write_rw.cpp
index cf9bf7b..548f7d9 100644
--- a/vpnor/test/write_rw.cpp
+++ b/vpnor/test/write_rw.cpp
@@ -26,7 +26,7 @@
int main(void)
{
- namespace fs = std::experimental::filesystem;
+ namespace fs = std::filesystem;
namespace test = openpower::virtual_pnor::test;
struct mbox_context _ctx, *ctx = &_ctx;