#include <tzplatform_config.h>
-#include <boost/filesystem.hpp>
-#include <boost/chrono/detail/system.hpp>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <climits>
#include <cstring>
+#include <filesystem>
#include <string>
#include "common/utils/file_util.h"
-namespace bf = boost::filesystem;
-namespace bs = boost::system;
+namespace fs = std::filesystem;
namespace {
LOG(ERROR) << "file_path attribute is empty";
return Step::Status::INVALID_VALUE;
}
- if (!boost::filesystem::exists(context_->file_path.get())) {
+ if (!std::filesystem::exists(context_->file_path.get())) {
LOG(ERROR) << "file_path ("
<< context_->file_path.get()
<< ") path does not exist";
LOG(ERROR) << "root_application_path attribute is empty";
return Step::Status::INVALID_VALUE;
}
- if (!boost::filesystem::exists(context_->root_application_path.get())) {
+ if (!std::filesystem::exists(context_->root_application_path.get())) {
LOG(ERROR) << "root_application_path ("
<< context_->root_application_path.get()
<< ") path does not exist";
}
Step::Status StepUnzip::process() {
- bf::path tmp_dir = GenerateTmpDir(kPackageUnpackDirPath);
+ fs::path tmp_dir = GenerateTmpDir(kPackageUnpackDirPath);
int64_t required_size =
GetUnpackedPackageSize(context_->file_path.get());
}
if (!CheckFreeSpaceAtPath(required_size,
- bf::path(context_->root_application_path.get()))) {
+ fs::path(context_->root_application_path.get()))) {
LOG(ERROR) << "There is not enough space to install application files";
return Step::Status::OUT_OF_SPACE;
}
}
- if (!ExtractToTmpDir(context_->file_path.get().string().c_str(), tmp_dir)) {
+ if (!ExtractToTmpDir(context_->file_path.get().c_str(), tmp_dir)) {
LOG(ERROR) << "Failed to process unpack step";
RemoveAll(tmp_dir);
return Step::Status::UNZIP_ERROR;
}
Step::Status StepUnzip::undo() {
- if (access(context_->unpacked_dir_path.get().string().c_str(), F_OK) == 0) {
+ if (access(context_->unpacked_dir_path.get().c_str(), F_OK) == 0) {
RemoveAll(context_->unpacked_dir_path.get());
LOG(DEBUG) << "remove temp dir: " << context_->unpacked_dir_path.get();
}