In that case you can't do it with Qt. Why would you want to do that anyway? The file is modified when it is written to the device, not when its original was written to some other device.
In that case you can't do it with Qt. Why would you want to do that anyway? The file is modified when it is written to the device, not when its original was written to some other device.
baray98 (18th April 2008)
I needed that info to be unchanged from the server.. so whatever is the last modified value from the server thats the time i should have in my downloaded copy. It will help me in many ways-thats why
baray98
Why not store the value elsewhere? Or use platform dependent code as already suggested.
Not entirely true. When you copy files cross device under windows (maybe linux and mac, not sure) the file time will be preserved.In that case you can't do it with Qt. Why would you want to do that anyway? The file is modified when it is written to the device, not when its original was written to some other device.
I'm pretty sure it can be done using standard c, read a file's attributes into a 'struct stat' then change the member you're interested in then apply them back somehow.Why not store the value elsewhere? Or use platform dependent code as already suggested.
I did it years ago but can't remember how atm.
Hmm that was a dopey thing to say.
The file creation time is set as the time written to the target device.
![]()
Actually I did it on a linux system, I think you need to use utime to do it.
There doesn't seem to be any standard support for it, I think mainly because the FS stuff is so specific to the OS.
Use utime for BSD and SetFileTime for windows. If you want it cross platform, you'll most likely need to write your own cross platform logic for it.
Bookmarks