| 1602 | #elif defined(Q_OS_MACOS) |
| 1603 | |
| 1604 | bool macos_bsd_clonefile(const std::string& src_path, const std::string& dst_path, std::error_code& ec) |
| 1605 | { |
| 1606 | // clonefile(const char * src, const char * dst, int flags); |
| 1607 | // https://www.manpagez.com/man/2/clonefile/ |
| 1608 | |
| 1609 | qDebug() << "attempting file clone via clonefile" << src_path.c_str() << "to" << dst_path.c_str(); |
| 1610 | if (clonefile(src_path.c_str(), dst_path.c_str(), 0) == -1) { |
| 1611 | qDebug() << "Failed to clone file:" << src_path.c_str() << "to" << dst_path.c_str(); |
| 1612 | qDebug() << "Error:" << strerror(errno); |
| 1613 | ec = std::make_error_code(static_cast<std::errc>(errno)); |
| 1614 | return false; |
| 1615 | } |
| 1616 | return true; |
| 1617 | } |
| 1618 | #endif |
| 1619 | |
| 1620 | /** |