[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

File creation time

Posted on 2004-03-20
9
Medium Priority
?
417 Views
Last Modified: 2013-11-20
Hi,

I'm try to figure out what the exact creation time of a file is. I've used

GetFileTime()

which will give me the time Windows thinks the file was created. But I need the absolute time it was created. For example, if I create a txt file on one computer, then send it to another computer, and use GetFileTime() on it, what will be returned is the time that it was made on the end user's machine, not the time it was created at the original computer.

Is it possible to get this information? I need it to check if a file I'm examining is the original file or just a copy.

Thanks
0
Comment
Question by:ragin_cajun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 10643616
I don't think you can get that information.
Can you write into the file itself a date/time stamp?
If you want to see if it has been modified you need to check other information and create a checksum for the file.
0
 
LVL 1

Author Comment

by:ragin_cajun
ID: 10644926
Andy,

If I embed a time stamp into the file - the time stamp will be copied over as well...

If I do a checksum on the original file, then a checksum on the copy, they should both return the same result as their contents haven't been modified, is this correct?

Thanks
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 10644991
If I embed a time stamp into the file - the time stamp will be copied over as well...

I don't know what happens to the file.  If the file is being modified by your app then the time stamp will match the create on the original BUT not the copy.



If I do a checksum on the original file, then a checksum on the copy, they should both return the same result as their contents haven't been modified, is this correct?


It ought to return the same.  Any change should alter the check sum.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:ragin_cajun
ID: 10645024
yeah that's the problem - the copying is done by the user with the OS (windows) - so I have no way to embed anything in the file when they choose to copy it through the OS..
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 10646991
Are you wanting to check if it has been modified? Yes - I think you will require a checksum.  No - exactly what is behind this requirement of the creation date?
0
 
LVL 1

Author Comment

by:ragin_cajun
ID: 10649628
Hi Andy,

Here's my problem - I have some license software that generates a key file - the key has an encrypted file coupled to it that keeps track of how many times the user has used my product.

What I'm worried about is that someone can simply copy the file that keeps track of # of uses when first installed on their machine, ie. at zero uses. When expiration has been reached, they can simply replace the original with the copy.

This is why I need to make sure the file is the original and not a copy...
0
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 860 total points
ID: 10649845
I thought it might be about limiting time of use in demo version.

What you are attempting to do (I am just being objective, no offence intended) seems to be quite a simple protection system and as you have noticed has a quite obvious hole in it.

Am I correct that it can be used say 20 times (not date limited, just usage).

One way around this could be you do not have the file on your original CD, it is created as part of the installation and at that time a date is written into this encrypted file.  At the same time a date is written into the registry.
Each time your program starts it can then check the date in the file AND the date in the registry, if they match both are updated with the current date.  So if someone copies this file then at a later date relaces the 'expired' one then the dates don't match any more.
You would still have to cope with someone de-installing and re-installing.
That would be a bit more robust but still open to someone monitoring the registry.

I use at times a secured Access database and check for other things as well.  (I'm not going to divulge everything I do for obvious reasons).

Practically everything you can think of could be circumvented, it's a question of how much you want to do and how determined you think the end users will be in wanting to crack your security.
0
 
LVL 1

Author Comment

by:ragin_cajun
ID: 10649971
It is indeed very simplistic no offense taken. It does seem that anything I can think of can be circumvented - such as storing info in the registry or a hidden file - they can always be monitored for changes..

I think I will have to do a large combination of many practices simply to make the process of fooling the security a pain in the ass.

Thanks for your input Andy.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 10650214
I do at least 2 independant things for a cross check.  At a minimum it makes it ***** awkward for the end-user to restore things to a clean state.
0

Featured Post

What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question