13 #ifndef __STOUT_OS_POSIX_COPYFILE_HPP__ 14 #define __STOUT_OS_POSIX_COPYFILE_HPP__ 41 const std::string& source,
const std::string& destination)
46 return Error(
"`source` was a directory");
49 if (
stat::isdir(destination) || destination.back() ==
'/') {
50 return Error(
"`destination` was a directory");
54 return Error(
"`source` was a relative path");
58 return Error(
"`destination` was a relative path");
76 #endif // __STOUT_OS_POSIX_COPYFILE_HPP__ bool is_absolute(const std::string &path)
Returns whether the given path is an absolute path.
Definition: path.hpp:158
Definition: nothing.hpp:16
Definition: errorbase.hpp:36
Try< Nothing > copyfile(const std::string &source, const std::string &destination)
Definition: copyfile.hpp:40
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
Definition: errorbase.hpp:50
Definition: posix_signalhandler.hpp:23
const T & get() const &
Definition: option.hpp:119
#define WEXITSTATUS(x)
Definition: windows.hpp:368
#define WIFEXITED(x)
Definition: windows.hpp:362
bool isdir(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:91
bool isNone() const
Definition: option.hpp:117
std::string stringify(int flags)
Option< int > spawn(const std::string &file, const std::vector< std::string > &arguments)
Definition: exec.hpp:32