PDA

View Full Version : QFileInfo and lastModified for directory



kghose
18th July 2008, 22:26
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

aamer4yu
19th July 2008, 09:58
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

kghose
20th July 2008, 14:34
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

kghose
21st July 2008, 22:12
Not to be annoying, but BUMP :) -K

kghose
28th July 2008, 15:07
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.