<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">Hi Thiago.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">Thanks for the feedback.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">I'm on Fedora 29 so definitely not on an old kernel as that. My colleague is on Ubuntu but I'm pretty sure it is a 16.xx release. I guess the usage of renameat2() is failing for some other reason. What could that be? Any idea?<br><br>Just in case, here is the code of the test. It basically create two temporary directories, starts watching on one of them via our <span class="gmail_default"></span><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">FileEventsGatherer class and once the files are moved via QFile::rename, it compares the number of registered move/renames with the expect ones. "mkFile" just creates the file via QFile. No more, no less.</span></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000"><br></div>void <span class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><----></span>::testMoveFile()<br>{<br> QFETCH(QStringList,<br> fileNames);<br> QFETCH(qint32,<br> expectedResult);<br> QFETCH(bool,<br> rename);<br><br> QTemporaryDir monitoredDir;<br> QTemporaryDir externalDir;<br> <span class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"></span>FileEventsGatherer feg;<br> feg.setPath(monitoredDir.path(),<br> FileEventsGatherer::FILE_EVENT__ALL,<br> OUTBOX_FILE_NAME_FILTER);<br> QSet<QString> overallMoved;<br> connect(&feg,<br> &FileEventsGatherer::filesMoved,<br> this,<br> [&overallMoved](QSet<QString> const &movedFiles)<br> {<br> overallMoved.unite(movedFiles);<br> });<br><br> for (auto const &file : fileNames)<br> {<br> QString const choosenPath {rename<br> ? monitoredDir.path()<br> : externalDir.path()};<br> auto const sourcePath = QString("%1/%2").arg(choosenPath).arg("TempName");<br> auto const destPath = QString("%1/%2").arg(monitoredDir.path()).arg(file);<br> <span class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"></span>mkFile(sourcePath);<br> QFile mover(sourcePath);<br> mover.rename(destPath);<br> }<br><br> QTest::qWait(SIGNALS_TIMEOUT_MS);<br> QCOMPARE(overallMoved.count(),<br> expectedResult);<br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000"><span style="font-family:Arial,Helvetica,sans-serif;color:rgb(34,34,34)">}</span> </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">Thanks,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000">F.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:#000000"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 15 Jun 2019 at 20:50, Thiago Macieira <<a href="mailto:thiago.macieira@intel.com" target="_blank">thiago.macieira@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Saturday, 15 June 2019 08:58:31 PDT Federico Buti wrote:<br>
> We gave strace a go and we noticed that 5.12 runtime acts differently for<br>
> rename/move operations (see attached compare screenshot). In particular, on<br>
> 5.6 we have an actual rename whereas a link/unlink sequence happens on<br>
> 5.12. That sequence is not detected by our code, generating the failure.<br>
<br>
Alternative: upgrade your system to a version that supports the renameat2() <br>
system call. You need a 3.16 Linux kernel and glibc 2.28.<br>
<br>
The link()/unlink() sequence is used on Unix filesystems to prevent rename() <br>
clobbering existing files, as promised in our API, but they're only attempted <br>
if renameat2() fails.<br>
<br>
-- <br>
Thiago Macieira - thiago.macieira (AT) <a href="http://intel.com" rel="noreferrer" target="_blank">intel.com</a><br>
Software Architect - Intel System Software Products<br>
<br>
<br>
<br>
_______________________________________________<br>
Interest mailing list<br>
<a href="mailto:Interest@qt-project.org" target="_blank">Interest@qt-project.org</a><br>
<a href="https://lists.qt-project.org/listinfo/interest" rel="noreferrer" target="_blank">https://lists.qt-project.org/listinfo/interest</a><br>
</blockquote></div>