Results 1 to 7 of 7

Thread: Getting the binary output from a file without changing the access date{RESOLVED}

  1. #1

    Thread Starter
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149

    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.

  2. #2
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    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.

  3. #3
    PowerPoster jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    2,399
    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.

  4. #4
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    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 .

  5. #5

    Thread Starter
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149
    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.

  6. #6
    PowerPoster
    Join Date
    Aug 2001
    Location
    new jersey
    Posts
    2,904
    Originally posted by BuggyProgrammer
    probably easiest to find code that can change the Last Accessed time.

    http://vbnet.mvps.org/index.html?cod...ledatetime.htm
    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.

  7. #7

    Thread Starter
    Addicted Member JRSofty's Avatar
    Join Date
    Jan 2004
    Location
    Somewhere in Germany
    Posts
    149
    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
  •  



Click Here to Expand Forum to Full Width