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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to get the sectors/clusters of a particular file?

How to get the sectors/clusters of a particular file?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 3 Posters 0 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.
  • J Offline
    J Offline
    jahfer
    wrote on last edited by
    #1

    Hi, How to get the sectors/clusters of a particular file? I am working on Windows 2000. Hoping to get a reply soon. TIA. regards, Jahfer V P.

    S D 2 Replies Last reply
    0
    • J jahfer

      Hi, How to get the sectors/clusters of a particular file? I am working on Windows 2000. Hoping to get a reply soon. TIA. regards, Jahfer V P.

      S Offline
      S Offline
      Sumit Kapoor
      wrote on last edited by
      #2

      Hi Jahfer, I think you just need to reach to cluster, then following function would let you know how many sectors are there in one cluster & bye info of sector. BOOL GetDiskFreeSpace( LPCTSTR lpRootPathName, // pointer to root path LPDWORD lpSectorsPerCluster, // pointer to sectors per cluster LPDWORD lpBytesPerSector, // pointer to bytes per sector LPDWORD lpNumberOfFreeClusters, // pointer to number of free clusters LPDWORD lpTotalNumberOfClusters // pointer to total number of clusters ); Then you need to iterate for sectors. Regards, Sumit Kapoor +91-98-990-59818(M) Delhi >> INDIA sumit_kapoor1980@rediffmail.com Never consider anything impossible before trying to solve that..---Sumit Kapoor---

      J 1 Reply Last reply
      0
      • S Sumit Kapoor

        Hi Jahfer, I think you just need to reach to cluster, then following function would let you know how many sectors are there in one cluster & bye info of sector. BOOL GetDiskFreeSpace( LPCTSTR lpRootPathName, // pointer to root path LPDWORD lpSectorsPerCluster, // pointer to sectors per cluster LPDWORD lpBytesPerSector, // pointer to bytes per sector LPDWORD lpNumberOfFreeClusters, // pointer to number of free clusters LPDWORD lpTotalNumberOfClusters // pointer to total number of clusters ); Then you need to iterate for sectors. Regards, Sumit Kapoor +91-98-990-59818(M) Delhi >> INDIA sumit_kapoor1980@rediffmail.com Never consider anything impossible before trying to solve that..---Sumit Kapoor---

        J Offline
        J Offline
        jahfer
        wrote on last edited by
        #3

        I need to get the sectors/clustors of a file. A file may be in contiguous sectors or may be scattered, on the disk. I want to get this sector information. Jahfer V P.

        S 1 Reply Last reply
        0
        • J jahfer

          I need to get the sectors/clustors of a file. A file may be in contiguous sectors or may be scattered, on the disk. I want to get this sector information. Jahfer V P.

          S Offline
          S Offline
          Sumit Kapoor
          wrote on last edited by
          #4

          I don't know it is fully possible or not with another API.. DeviceIOControl(). This API is used for similar type of work, even file related. Check MSDN for more detail. I think it would be only help that I can do. Let me know if you get any direct method(by e-mail). Regards, Sumit Kapoor +91-98-990-59818(M) Delhi >> INDIA sumit_kapoor1980@rediffmail.com Never consider anything impossible before trying to solve that..---Sumit Kapoor---

          1 Reply Last reply
          0
          • J jahfer

            Hi, How to get the sectors/clusters of a particular file? I am working on Windows 2000. Hoping to get a reply soon. TIA. regards, Jahfer V P.

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

            Because of the HAL, I think you'll need to create a device driver if you want that level of access.


            "Ideas are a dime a dozen. People who put them into action are priceless." - Unknown

            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