MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / macos_bsd_clonefile

Function macos_bsd_clonefile

launcher/FileSystem.cpp:1604–1617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1602#elif defined(Q_OS_MACOS)
1603
1604bool 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/**

Callers 1

clone_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected