[Interest] QFileDevice::fileTime and QFileDevice::setFielTime

Scott Bloom scott at towel42.com
Wed Nov 10 23:33:05 CET 2021


While QFileDevice::fileTime works on files and directories, however it doesn't appear it is possible to use setFileTime on a directory.

For a given paths the following works great for two files

QFile file1( path1 );
auto dt = file1.fileTime( QFileDevice::FileBirthTime );

QFile file2( path2 );
File2.open( QFile::ReadWrite | QFile::ExistingOnly );
File2.setFileTime( path2, QFileDevice::FileBirthTime );

However, when path 2 is a directory, the open fails (it's a directory after all) and setFileTime only works on open files.

Is there anyway (besides fixing QFSFileEngine::setFileTime) to support setting the time stamp on a directory?

Scott


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20211110/b35142a9/attachment.html>


More information about the Interest mailing list