Commit 4f43a21a authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Add RPC to remotely stat() resources

parent 45fdee94
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -168,8 +168,6 @@ liburd_aux_la_SOURCES = \
	io/transferors/local-path-to-remote-resource.hpp \
	io/transferors/remote-resource-to-local-path.cpp \
	io/transferors/remote-resource-to-local-path.hpp \
	io/transferors/tar-archive.cpp \
	io/transferors/tar-archive.hpp \
	io/transferors/memory-to-local-path.cpp \
	io/transferors/memory-to-local-path.hpp \
	io/transferors/memory-to-shared-path.cpp \
@@ -190,7 +188,9 @@ liburd_aux_la_SOURCES = \
	urd.cpp	\
	urd.hpp	\
	utils.cpp \
	utils.hpp
	utils.hpp \
	utils/tar-archive.cpp \
	utils/tar-archive.hpp

nodist_liburd_aux_la_SOURCES = \
	config/defaults.cpp \
+0 −1
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include "backends/posix-fs.hpp"
#include "hermes.hpp"
#include "rpcs.hpp"
#include "tar-archive.hpp"
#include "local-path-to-remote-resource.hpp"


+0 −1
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@
#include "io/task-stats.hpp"
#include "hermes.hpp"
#include "rpcs.hpp"
#include "tar-archive.hpp"
#include "remote-resource-to-local-path.hpp"

namespace {
+10 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ namespace bfs = boost::filesystem;
#include "local-path-info.hpp"
#include "local-path-impl.hpp"
#include "backends/posix-fs.hpp"
#include "utils.hpp"
#include "logger.hpp"

namespace norns {
@@ -67,6 +68,15 @@ local_path_resource::is_collection() const {
    return m_is_collection;
}

std::size_t
local_path_resource::packed_size() const {
    std::error_code ec;
    std::size_t sz = 
        utils::tar::estimate_size_once_packed(m_canonical_path, ec);

    return ec ? 0 : sz;
}

const std::shared_ptr<const storage::backend>
local_path_resource::parent() const {
    return std::static_pointer_cast<const storage::backend>(m_parent);
+1 −0
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ struct resource_impl<resource_type::local_posix_path> : public resource {
    std::string name() const override final;
    resource_type type() const override final;
    bool is_collection() const override final;
    std::size_t packed_size() const override final;
    const std::shared_ptr<const storage::backend> parent() const override final;
    std::string to_string() const override final;

Loading