Get "dateModified" from files?
by Mirko Topalski · in Torque Game Builder · 10/24/2006 (1:10 pm) · 6 replies
Is it possible in TGB to get properties of files, like date when it was modified, created or accessed?
About the author
#2
Yes if you want to add a function to do it.
No if you want it to be already built in. (at least as far as I know)
10/28/2006 (3:52 pm)
The answer as you've stated the question is "both"Yes if you want to add a function to do it.
No if you want it to be already built in. (at least as far as I know)
#3
So it IS possible, thnx.
Why do i nead it? For character-file-edit protection. I invented a new (i think its new) file-edit protection that i want to try: In file, i will write date when it was accesed, and date when it was modified (full date + milliseconds) if that doesn't match the file's true properties, than it means that the file is "hacked" by user.
Do you think it will work?
10/29/2006 (2:09 pm)
Ok, so i nead a C++ knowlegde for that, to implement that function?So it IS possible, thnx.
Why do i nead it? For character-file-edit protection. I invented a new (i think its new) file-edit protection that i want to try: In file, i will write date when it was accesed, and date when it was modified (full date + milliseconds) if that doesn't match the file's true properties, than it means that the file is "hacked" by user.
Do you think it will work?
#4
10/30/2006 (8:45 am)
I don't think it will work. I just did a google search. On my first try I found the first ten links were all to people who have programs for changing file properties. A user can just edit the date properties of the file and make them match whatever is in the file.
#5
As someone already said somwhere on this forum: "file protection is not to stop the hackers, but the normal people".
I dont think anyone can stop hackers :)
10/30/2006 (1:17 pm)
Ok, well it coud be one "line of defence" beside to "standard" data protection (whichever it might be). Someone who doesnt know the pricip of this kind of protection, will hardly figure out.As someone already said somwhere on this forum: "file protection is not to stop the hackers, but the normal people".
I dont think anyone can stop hackers :)
#6
1. The encryption
2. A checksum for the contents of the file stored within the file
Something even simpler, you can have one file that's the data and another that contains a set of checksums for the data. Compare a checksum calculated prior to accessing the file to the one stored. If they match, then everything's Ok. If not, it's either tampered or corrupt.
10/30/2006 (2:28 pm)
If you're trying to protect some data you've made, then the best line of defense is to encrypt it. There are lots of methods, or you can come up with your own. Writing your own isn't at all hard to do. You can even include two layers of security:1. The encryption
2. A checksum for the contents of the file stored within the file
Something even simpler, you can have one file that's the data and another that contains a set of checksums for the data. Compare a checksum calculated prior to accessing the file to the one stored. If they match, then everything's Ok. If not, it's either tampered or corrupt.
Torque Owner Mirko Topalski