mergerfs/src/fs_copyfile.hpp

34 lines
677 B
C++
Raw Permalink Normal View History

2025-06-23 21:57:55 -05:00
#pragma once
#include "int_types.h"
2025-06-23 21:57:55 -05:00
#include <filesystem>
#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
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
}