QFileInfo and lastModified for directory
Hi,
I'm getting a list of subdirectories and files of a super-directory. I'm then checking for when one of the sub-directories was last modified.
My .lastModified() call to the QFileInfo runs but only gives me the correct information when its a file. When its a directory I get the creation date. If I check the properties of the directory in finder (I'm on Mac OS X) the directory is shown correctly to have been modified if, say a file is moved into it.
How do I get the last modified time for a directory?
Thanks!
-Kaushik
Re: QFileInfo and lastModified for directory
You may write your own criteria for it.
As far as I understand Directory isnt a file actually, so 'modify' property will depend on the sub folders and files in it.
Hope am making sense :D
Re: QFileInfo and lastModified for directory
Hi aamer4yu,
Thanks for your reply.
I understand that the directory modify property depends on the children. I want this behavior. However, when I read the lastModified property it does NOT reflect this property. I was wondering what property of QFileInfo I need to access to get this.
Thanks
-K
Re: QFileInfo and lastModified for directory
Not to be annoying, but BUMP :) -K
Re: QFileInfo and lastModified for directory
Hmm, I didn't understand 'touch'. Touching a file will alter its modified date BUT will not affect the super-directory, so QT is doing just fine, I was mistaken.