MCPcopy Create free account
hub / github.com/3rdparty/libprocess / PATH

Method PATH

src/windows/subprocess.cpp:78–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76
77
78Subprocess::IO Subprocess::PATH(const string& path)
79{
80 return Subprocess::IO(
81 [path]() -> Try<InputFileDescriptors> {
82 const Try<int_fd> open = os::open(path, O_RDONLY);
83
84 if (open.isError()) {
85 return Error(open.error());
86 }
87
88 return InputFileDescriptors{open.get(), None()};
89 },
90 [path]() -> Try<OutputFileDescriptors> {
91 const Try<int_fd> open = os::open(path, O_WRONLY | O_CREAT | O_APPEND);
92
93 if (open.isError()) {
94 return Error(open.error());
95 }
96
97 return OutputFileDescriptors{None(), open.get()};
98 });
99}
100
101} // namespace process {

Callers

nothing calls this directly

Calls 2

IOClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected