Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions include/chia/copy.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@
#include <cstdio>
#include <cstdint>

#include <filesystem>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that has created many problems before, gotta souround all of it with #ifdef __linux__

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, no real programming experience so forgive my terrible coding...

namespace fs = std::filesystem;

inline
uint64_t copy_file(const std::string& src_path, const std::string& dst_path)
{
int plotsize = 109000000000
fs::space_info tmp = fs::space(dst_path);
if(tmp.available < plotsize) {
throw std::runtime_error("Destination does not have enough available disk space left");
}
FILE* src = fopen(src_path.c_str(), "rb");
if(!src) {
throw std::runtime_error("fopen() failed");
Expand Down