Nominate our 2022 Qt Champions!

Windows filesystem sync issues?

  • I've run into interesting problems using Exiftool 10.10+, Qt 5.5.1 and Windows 10.

    I'm creating temporary file with QTemporaryFile, write there some data, save it, wait untill it's flushed using FlushFileBuffers() and afterwards pass this file as arguments file for exiftool. Data which I'm writing there is UTF-8 encoded paths to images:

    QTemporaryFile argumentsFile;
    if ( {
        QStringList exiftoolArguments = createArgumentsList();
        foreach (const QString &line, exiftoolArguments) {
    // fsync stuff here...
    // starting exiftool with -@ argumentsFile.fileName() parameter here 
    // also with -charset filename=UTF8

    So the problem is the following: when filenames does not contain Unicode symbols, Exiftool reads images, imports Exif metadata and everything is fine.

    But when filenames contain Unicode symbols, sometimes Exiftool does not catch up them, unless I will insert QThread::sleep(msec) call which will make current thread to switch context and possible give ability to sync buffers for other threads (writing to harddrive).

    Exiftool run from cmd line with same file always reads metadata, unless started with QProcess with the way explained before. What can be the issue?

Log in to reply