Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    The -b option is equivalent to --apparent-size --block-size=1 and that would output the logical, not physical, size. You don't want --apparent-size but just --block-size=1. Commented Jul 2, 2024 at 11:10
  • 1
    I've changed the "-b" to "--block-size=1" Commented Jul 2, 2024 at 13:56
  • 2
    Why not use a straight-forward physicalSize < logicalSize instead of checking whether the quotient is smaller than one? And keep in mind that this only works if someone has written data to a large position, i.e. there are actual gaps in the file, whilst a file not having gaps or even being empty still can be marked as “sparse”. Commented Sep 18 at 8:20