Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7024999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:55:00+00:00 2026-05-27T23:55:00+00:00

My questions is: how would it be possible to get the file disk offset

  • 0

My questions is: how would it be possible to get the file disk offset if this file (very important) is small (less than one cluster, only a few bytes).

Currently I use this Windows API function:

DeviceIOControl(FileHandle, FSCTL_GET_RETRIEVAL_POINTERS, @InBuffer, SizeOf(InBuffer), @OutBuffer, SizeOf(OutBuffer), Num, Nil);
FirsExtent.Start := OutBuffer.Pair[0].LogicalCluster ;

It works perfectly with files bigger than a cluster but it just fails with smaller files, as it always returns a null offset.

What is the procedure to follow with small files ? where are they located on a NTFS volume ? Is there an alternative way to know a file offset ? This subtility doesn’t seem to be documented anywhere.

Note: the question is tagged as Delphi but C++ samples or examples would be appreciated as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:55:01+00:00Added an answer on May 27, 2026 at 11:55 pm

    The file is probably resident, meaning that its data is small enough to fit in its MFT entry. See here for a slightly longer description:

    http://www.disk-space-guide.com/ntfs-disk-space.aspx

    So you’d basically need to find the location of the MFT entry in order to know where the data is on disk. Do you control this file? If so the easiest thing to do is make sure that it’s always larger than the size of an MFT entry (not a documented value, but you could always just do 4K or something).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I apologise in advance if this question isn't very specific. Would it be possible
I have found possible slowdown in my app so I would have two questions:
Possible Duplicate: When to Use Static Classes in C# Questions in the title..........i would
Here is my question, Would it be possible, knowing that classic asp support server-side
Question So I've recently came up with some new possible projects that would have
General javascript question here, which would also be good to know how(if possible) to
I would like to ask couple of Questions regarding the use of Monitor Class
My questions is simple! Would you start learning Smalltalk if you had the time?
While related questions have been asked before I would like to see an idea
Just wondering how you would go about implementing something similar to stackoverflow'd related questions.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.