Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to find if a Directory is Indexed?

How to find if a Directory is Indexed?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studiotutorialquestion
5 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bryan Anslow
    wrote on last edited by
    #1

    Hi, I have a simple program that uses WIN32_FIND_DATA with the usual GetFirstFile() GetNextFile() etc. What I need to be able to do is find out if the directories I pass through are Indexed or not. I cannot see an Indexed Attribute in WIN32_FIND_DATA, so that it obviously not the place to look. Also, is there some way to programmatically set a Directory as Indexed? Visual Studio 2008, Vista 64 Bit. Thanks for any advice, Bryan.

    modified on Sunday, February 21, 2010 4:10 PM

    S 1 Reply Last reply
    0
    • B Bryan Anslow

      Hi, I have a simple program that uses WIN32_FIND_DATA with the usual GetFirstFile() GetNextFile() etc. What I need to be able to do is find out if the directories I pass through are Indexed or not. I cannot see an Indexed Attribute in WIN32_FIND_DATA, so that it obviously not the place to look. Also, is there some way to programmatically set a Directory as Indexed? Visual Studio 2008, Vista 64 Bit. Thanks for any advice, Bryan.

      modified on Sunday, February 21, 2010 4:10 PM

      S Offline
      S Offline
      Spawn Melmac
      wrote on last edited by
      #2

      Now assuming that the target system is using NTFS, the Indexing service is running and that the folder you are interrogating is included in the list of items the service will index THEN the file attribute FILE_ATTRIBUTE_NOT_CONTENT_INDEXED[^] is your best bet. Check Win32_ServerFeature in WMI for ID 71 Indexing Service Then look at ISearchCrawlScopeManager[^] at ways to query the indexing service. Hope this helps.

      Alan

      B 1 Reply Last reply
      0
      • S Spawn Melmac

        Now assuming that the target system is using NTFS, the Indexing service is running and that the folder you are interrogating is included in the list of items the service will index THEN the file attribute FILE_ATTRIBUTE_NOT_CONTENT_INDEXED[^] is your best bet. Check Win32_ServerFeature in WMI for ID 71 Indexing Service Then look at ISearchCrawlScopeManager[^] at ways to query the indexing service. Hope this helps.

        Alan

        B Offline
        B Offline
        Bryan Anslow
        wrote on last edited by
        #3

        Hi Alan, looks like there is a bit more to this Indexing Service than just getting an attribute bit... It seems to me that the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED is saying that the associated file is to be excluded from Indexing, so is not too useful for my purposes. I have been looking at the OLE DB Provider and its interaction with the Indexing Service, but this "simple" project is not going to be as easy as I had hoped. So I will leave this one on the back-burner for now. Thanks, Bryan.

        D 1 Reply Last reply
        0
        • B Bryan Anslow

          Hi Alan, looks like there is a bit more to this Indexing Service than just getting an attribute bit... It seems to me that the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED is saying that the associated file is to be excluded from Indexing, so is not too useful for my purposes. I have been looking at the OLE DB Provider and its interaction with the Indexing Service, but this "simple" project is not going to be as easy as I had hoped. So I will leave this one on the back-burner for now. Thanks, Bryan.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Bryan Anslow wrote:

          It seems to me that the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED is saying that the associated file is to be excluded from Indexing, so is not too useful for my purposes.

          Wouldn't the lack of the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED bit being set indicate this it is being indexed?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Man who follows car will be exhausted." - Confucius

          S 1 Reply Last reply
          0
          • D David Crow

            Bryan Anslow wrote:

            It seems to me that the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED is saying that the associated file is to be excluded from Indexing, so is not too useful for my purposes.

            Wouldn't the lack of the FILE_ATTRIBUTE_NOT_CONTENT_INDEXED bit being set indicate this it is being indexed?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            S Offline
            S Offline
            Spawn Melmac
            wrote on last edited by
            #5

            True. IF, and it is a big one, you have the index service installed, running and the folder was in the list.

            Alan

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups