-
Mar 16th, 2004, 09:57 AM
#1
Thread Starter
Addicted Member
Getting the binary output from a file without changing the access date{RESOLVED}
I'm working with some code for calculating the MD5 of a file that I got from another website.
The code actually uses an Open Filename for Binary As #Fnum
Is there a way to retrieve the Binary information from a file without accessing it? The reason I'm asking is the application that I'm working on is suppose to inform the user of how many duplicate files there are on a file server and also tell the user which ones are accessed.
I'm using the MD5 to help identify the duplicate files but I can't seem to do so without changing the Last Accessed attribute.
Any ideas?
Last edited by JRSofty; Mar 17th, 2004 at 10:35 AM.
-
Mar 16th, 2004, 11:11 AM
#2
PowerPoster
think about what you're asking --- you want to access the file without accessing the file, yes?
Actually, there IS a way, but you most likely don't want to go there. You can use an API call (DirectIO...something) that will allow you to read sectors from a disk and you can use it to decipther from the FAT just where the file is that you want to access and you can then use it (the API call) to read the file by sectors, without recourse to the Windows file system so windows doesn't change the access date.
-
Mar 16th, 2004, 03:52 PM
#3
Depending on how often this program is to be run, another option would be to obtain a directory listing of all of the files you will be looking at, so you can preserve the original last access date, then combine that with the data you obtain by accessig the files in order to prepare your report. The last access dates will still be changed though.
-
Mar 16th, 2004, 04:33 PM
#4
The picture isn't missing
probably easiest to find code that can change the Last Accessed time.
http://vbnet.mvps.org/index.html?cod...ledatetime.htm
Remember, if someone's post was not helpful, you can always rate their post negatively .
-
Mar 17th, 2004, 01:33 AM
#5
Thread Starter
Addicted Member
Thanks for the information.
I was pretty sure that there would be no way of doing so but I'm also not an expert programmer so I thought I would see what others said about it.
I've already talked to the person I'm writing the program for and he said that modified date would be more important. So as long as I don't modify the programs then it should be no problem.
-
Mar 17th, 2004, 08:08 AM
#6
PowerPoster
That's just silly. Of course the code you reference changes the access time to whatever you want it to be, and then as soon as it has done so, windows changes it AGAIN to be RIGHT NOW, because the code just accessed the file, so the code is utterly useless as far as actually changing the access time stamped on the file.
-
Mar 17th, 2004, 10:40 AM
#7
Thread Starter
Addicted Member
I have to agree with the last comment.
It makes no difference if I make a change and then windows changes it back.
I've marked this one Resolved because unless I wish to go mucking about reading the bits directly off the hard drive then there is no way around this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|