| 618 | | if (unlink(oldfile) == -1) |
| 619 | | perror(QString("mythtranscode: Error Deleting '%1'") |
| 620 | | .arg(oldfile).ascii()); |
| | 618 | int err; |
| | 619 | bool followLinks = gContext->GetNumSetting("DeletesFollowLinks", 0); |
| | 620 | |
| | 621 | VERBOSE(VB_FILE, QString("mythtranscode: About to unlink/delete file: %1").arg(oldfile)); |
| | 622 | if (followLinks) |
| | 623 | { |
| | 624 | QFileInfo finfo(oldfile); |
| | 625 | if (finfo.isSymLink() && (err = unlink(finfo.readLink().local8Bit()))) |
| | 626 | { |
| | 627 | VERBOSE(VB_IMPORTANT, QString("Error deleting '%1' @ '%2', %3") |
| | 628 | .arg(oldfile).arg(finfo.readLink().local8Bit()) |
| | 629 | .arg(strerror(errno))); |
| | 630 | } |
| | 631 | } |
| | 632 | |
| | 633 | if ((err = unlink(oldfile.local8Bit()))) |
| | 634 | VERBOSE(VB_IMPORTANT, QString("mythtranscode: Error deleting '%1', %2") |
| | 635 | .arg(oldfile).arg(strerror(errno))); |