2025-06-23 21:57:55 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
2025-06-28 17:27:40 -05:00
|
|
|
#include "int_types.h"
|
|
|
|
|
|
2025-06-23 21:57:55 -05:00
|
|
|
#include <filesystem>
|
|
|
|
|
|
2025-06-28 17:27:40 -05:00
|
|
|
#include <sys/stat.h>
|
|
|
|
|
|
|
|
|
|
#define FS_COPYFILE_NONE (0)
|
|
|
|
|
#define FS_COPYFILE_CLEANUP_FAILURE (1 << 0)
|
|
|
|
|
|
2025-06-23 21:57:55 -05:00
|
|
|
namespace fs
|
|
|
|
|
{
|
2025-07-27 16:23:45 -05:00
|
|
|
struct CopyFileFlags
|
|
|
|
|
{
|
|
|
|
|
int cleanup_failure:1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
s64
|
2025-06-28 17:27:40 -05:00
|
|
|
copyfile(const int src_fd,
|
|
|
|
|
const struct stat &src_st,
|
|
|
|
|
const int dst_fd);
|
|
|
|
|
|
2025-07-27 16:23:45 -05:00
|
|
|
s64
|
|
|
|
|
copyfile(const int src_fd,
|
|
|
|
|
const std::filesystem::path &dst_filepath,
|
|
|
|
|
const CopyFileFlags &flags);
|
|
|
|
|
|
|
|
|
|
s64
|
|
|
|
|
copyfile(const std::filesystem::path &src_filepath,
|
|
|
|
|
const std::filesystem::path &dst_filepath,
|
|
|
|
|
const CopyFileFlags &flags);
|
2025-06-23 21:57:55 -05:00
|
|
|
}
|