mirror of https://github.com/kiwix/libkiwix.git
Fix hardlinking in copyFile()
This commit is contained in:
parent
d7a2b44902
commit
7903458e38
|
@ -195,7 +195,7 @@ bool makeDirectory(const string &path) {
|
||||||
bool copyFile(const string &sourcePath, const string &destPath) {
|
bool copyFile(const string &sourcePath, const string &destPath) {
|
||||||
try {
|
try {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
if (link(sourcePath.c_str(), destPath.c_str())) {
|
if (link(sourcePath.c_str(), destPath.c_str()) != 0) {
|
||||||
#endif
|
#endif
|
||||||
std::ifstream infile(sourcePath.c_str(), std::ios_base::binary);
|
std::ifstream infile(sourcePath.c_str(), std::ios_base::binary);
|
||||||
std::ofstream outfile(destPath.c_str(), std::ios_base::binary);
|
std::ofstream outfile(destPath.c_str(), std::ios_base::binary);
|
||||||
|
|
Loading…
Reference in New Issue