File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11#include " hopper/daemon/daemon.hpp"
2+ #include " hopper/daemon/util.hpp"
3+ #include < filesystem>
24#include < iostream>
35
46namespace hopper {
@@ -19,6 +21,22 @@ uint32_t HopperDaemon::create_endpoint(const std::filesystem::path &path) {
1921
2022 std::cout << " CREATE " << *endpoint << std::endl;
2123
24+ // Open anything that may already exist in the endpoint
25+ for (const auto &dir_entry : std::filesystem::directory_iterator{path}) {
26+ const auto &p = dir_entry.path ();
27+
28+ PipeType pipe_type = detect_pipe_type (p);
29+ if (pipe_type == PipeType::NONE)
30+ continue ;
31+
32+ HopperPipe *pipe =
33+ (pipe_type == PipeType::IN ? endpoint->add_input_pipe (p)
34+ : endpoint->add_output_pipe (p));
35+
36+ if (pipe != nullptr )
37+ add_pipe (pipe);
38+ }
39+
2240 return endpoint_id;
2341}
2442
You can’t perform that action at this time.
0 commit comments