13 #ifndef __STOUT_OS_POSIX_COPYFILE_HPP__
14 #define __STOUT_OS_POSIX_COPYFILE_HPP__
39 const std::string& source,
const std::string& destination)
44 return Error(
"`source` was a directory");
47 if (
stat::isdir(destination) || destination.back() ==
'/') {
48 return Error(
"`destination` was a directory");
52 return Error(
"`source` was a relative path");
56 return Error(
"`destination` was a relative path");
74 #endif // __STOUT_OS_POSIX_COPYFILE_HPP__
Definition: nothing.hpp:16
Definition: errorbase.hpp:35
Try< Nothing > copyfile(const std::string &source, const std::string &destination)
Definition: copyfile.hpp:38
int spawn(const std::string &command, const std::vector< std::string > &arguments)
Definition: shell.hpp:159
Result< ProcessStatus > status(pid_t pid)
Definition: proc.hpp:166
Definition: errorbase.hpp:49
bool absolute(const std::string &path)
Returns whether the given path is an absolute path.
Definition: path.hpp:96
#define WEXITSTATUS(x)
Definition: windows.hpp:376
#define WIFEXITED(x)
Definition: windows.hpp:370
bool isdir(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:78
std::string stringify(int flags)