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 (argumentsFile.open()) {
        QStringList exiftoolArguments = createArgumentsList();
        foreach (const QString &line, exiftoolArguments) {
            argumentsFile.write(line.toUtf8());
            argumentsFile.write("\r\n");
        }
    }
    
    argumentsFile.flush()
    
    // fsync stuff here...
    
    argumentsFile.close()
    
    // 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
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.