add: cout << "link from: " << _path.ascii() << endl; cout << "link to  : " << linkTarget.ascii() << endl;
context: writeMessage(const QString & s){    QString canonName = generateUnique();    QString _path = path + "/tmp/" + canonName;    QFile f(_path);    if (f.exists()) {                cerr << "Couldn't get a free filename for writing mail file." << endl;        cerr << "Timing out for 2 seconds." << endl;                usleep(2000);            if (f.exists()) {            cerr << "Still couldn't get a free filename." << endl;            cerr << "Giving up on this message." << endl;            return false;        }    }    if (!f.open(IO_WriteOnly)) {        cerr <<            "Couldn't open mail file for writing." << endl;        return false;    }    QDataStream outputStream(&f);    outputStream.writeRawBytes(s.ascii(), s.length());        f.flush();    f.close();        if (f.status() != IO_Ok) {                cerr << "Couldn't close() file";        f.close();        f.remove();        return false;    }    QString linkTarget(path + "/new/" + canonName);        if (::link(_path.ascii(), linkTarget.ascii()) != 0) {        cerr << "Couldn't successfully link mail file - giving up" << endl;        perror("link");        f.close();        f.remove();        return false;    }    return true;}