Jump to content


Fast file and folder information


10 replies to this topic

#1 eddie

    Senior Member

  • Members
  • PipPipPipPip
  • 751 posts

Posted 03 July 2006 - 03:51 PM

Hey!

I was just reading a post on the 2BrightSparks forum here, and one of their developers writes:

"Those of you who've tried UndeleteOnClick will know that it can scan the disk and produce a list of every file and folder on a disk in just a few seconds. On my development PC it can return all 10,000+ files and 5,000+ folders in less than two seconds. That's very quick. It can do this because it reads the file and folder information directly from the disk instead of using the usual Win32 API's (FindFirst, FindNext)."

To me, that's rather vague. I'd love to know how he's done this. I'm tempted to ask him outright, but I'm sure that a developer telling people about their secret sauce on a work website is a no-no.

Anyone have any idea what he means about "reads the file and folder information directly from disk"? Does he manually parse the file table structure? If so, are there API's for that, or would he be leveraging some in-house code for that?

Curiouser and curiouser....

#2 Ed Mack

    Senior Member

  • Members
  • PipPipPipPip
  • 1239 posts

Posted 03 July 2006 - 10:20 PM

Being from a nix viewpoint, I'm surprised you have raw access to the disk from a user program!

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 5308 posts
  • LocationSanta Clara, CA

Posted 03 July 2006 - 10:46 PM

There are data recovery programs like GetDataBack and so forth that try to read the raw structure of a bad disk, so presumably some kind of API for that exists in Windows.
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 eddie

    Senior Member

  • Members
  • PipPipPipPip
  • 751 posts

Posted 03 July 2006 - 10:51 PM

That's what I would assume.. Hrmm.... It's one of those things that I don't need urgently, but it would be nicer than FindFileFirst() and crap. :)

One day I'll find it.. One day...

#5 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 698 posts

Posted 04 July 2006 - 10:03 AM

You can get raw access to the disk using the usual CreateFile API, giving "\\.\PHYSICALDRIVE0" or "\\.\C:" as filename. And then you should manually parse the FAT/NTFS/whatever structures. And I believe that it will be way much faster indeed.

#6 Alex

    Valued Member

  • Members
  • PipPipPip
  • 152 posts

Posted 04 July 2006 - 12:43 PM

I hope you don't intend to write to an NTFS partition directly though..many have failed at that.

#7 roel

    Senior Member

  • Members
  • PipPipPipPip
  • 698 posts

Posted 04 July 2006 - 01:39 PM

Yeah, that seems quite dangerous to me too.

#8 eddie

    Senior Member

  • Members
  • PipPipPipPip
  • 751 posts

Posted 04 July 2006 - 03:04 PM

Hah, no.

I'll be looking for information off of it. I can stand normal file writing operations. ;)

#9 .oisyn

    DevMaster Staff

  • Moderators
  • 1842 posts

Posted 04 July 2006 - 08:53 PM

What about just opening a directory? (which can also be done by CreateFile)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#10 eddie

    Senior Member

  • Members
  • PipPipPipPip
  • 751 posts

Posted 04 July 2006 - 09:29 PM

.oisyn said:

What about just opening a directory? (which can also be done by CreateFile)
... what about it? (Sorry, I don't know what you're asking).

#11 .oisyn

    DevMaster Staff

  • Moderators
  • 1842 posts

Posted 04 July 2006 - 10:45 PM

Maybe that's also faster than findfile, although a findfile probably does the same thing
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users