fsize: A more intuitive way to search by displayed/rounded file size

Discussion related to "Everything" 1.5.
maznar
Posts: 1
Joined: Wed Jul 29, 2026 4:10 pm

fsize: A more intuitive way to search by displayed/rounded file size

Post by maznar »

Hi void,

Here's an fsize: filter expression I put together with the help of ChatGPT 5.6 Sol:

Code: Select all

#[iflen:$param:#,:[define:_q=[regexreplace:[unquote:$param:],",",""]][define:_u=[lower:[regexextract:[_q:],"([a-z]+)$"]]][define:_n=[regexextract:[_q:],"^([0-9.]+)"]][define:_m=[switch:[_u:],k,1024,kb,1000,kib,1024,m,1048576,mb,1000000,mib,1048576,g,1073741824,gb,1000000000,gib,1073741824,t,1099511627776,tb,1000000000000,tib,1099511627776,b,1,1]][define:_d=[regexextract:[_q:],"\.([0-9]+)"]][define:_p=[len:[_d:]]][define:_s=[eval:[_m:]/[power:10,[_p:]]]]$size:>[eval:[_n:]*[_m:]-([_p:]==0)*[_m:]-([_p:]>0)*[_s:]/2] $size:<=[eval:[_n:]*[_m:]+([_p:]>0)*[_s:]/2]#,:#]:
This is intended as a more intuitive alternative to size: when searching for a value exactly as it appears in Everything's Size column or in Windows Properties.

For example, one test file has an exact size of 3,988,632 bytes, or approximately 3895.148 KiB / 3.803856 MiB. It is displayed as 3896 KB in Everything and 3.80 MB in Windows Properties:

Code: Select all

size:3896k   -> no match
fsize:3896k  -> match

size:3.80m   -> match
fsize:3.80m  -> match
The two decimal searches match this particular file for different reasons. Native size:3.80m searches the floored range from 3.80 MiB up to, but not including, 3.81 MiB. By contrast, fsize:3.80m searches the centered rounding range of approximately 3.795 MiB through 3.805 MiB. This file happens to fall within the overlap.

Whole-number values: fsize:3896k effectively means 3895 KiB < size <= 3896 KiB. The discrepancy occurs because Everything displays integer KB values using ceiling rounding: the file is actually about 3895.148 KiB but is displayed as 3896 KB. Native size:3896k instead searches forward from 3896 KiB, so the file falls below its range.

Decimal values: fsize:3.8m matches approximately 3.75 MiB < size <= 3.85 MiB, while fsize:3.80m matches approximately 3.795 MiB < size <= 3.805 MiB. Native size: uses a forward, floored bucket at the precision entered rather than centering the range. Trailing zeros therefore intentionally narrow both searches, but the resulting ranges are different.

Supported units: b, k, m, g, t, kb, mb, gb, tb, kib, mib, gib, tib
  • No suffix means bytes.
  • k/m/g/t and kib/mib/gib/tib are 1024-based.
  • kb/mb/gb/tb are 1000-based.
  • Commas and uppercase suffixes are supported.
  • An empty fsize: is ignored.
Example usage:

Code: Select all

fsize:3,988,632
fsize:3896k
fsize:3.80m
fsize:5mb
fsize:5mib
To use it, create a filter named Fuzzy Size with the macro fsize, then paste the expression into its Search field.

Is there already a cleaner built-in way to search for the displayed or rounded Size-column value, or a simpler way to write this expression?

Why not just enable size_search_ceil?

I considered enabling size_search_ceil, but I did not want to globally change the behavior of native size: searches. I still want searches such as size:1kb, size:>5m, and size:1m-10m to retain their normal semantics. So fsize: is meant to be a separate opt-in search for matching displayed sizes, with added support for explicit IEC binary units such as KiB, MiB, GiB, and TiB.

Thoughts?
void
Developer
Posts: 20194
Joined: Fri Oct 16, 2009 11:31 pm

Re: fsize: A more intuitive way to search by displayed/rounded file size

Post by void »

Is there already a cleaner built-in way to search for the displayed or rounded Size-column value, or a simpler way to write this expression?
No, not for matching approximate values.


Why not just enable size_search_ceil?
size_ceil_search

size_ceil_search is unintuitive too.
size:1mb
will match a file that is 1 byte.
The advantage of size_ceil_search is a search for
size:1kb
will match files that show a size of 1kb.

Another option is to show floored sizes with size_ceil
Setting size_ceil to floor will display floored sizes.
Unfortunately, this means a file with the size of 1023 bytes is shown as 0 KB.
The advantage of size_ceil is a search for
size:1kb
will match files that show a size of 1kb.

Please also consider setting the Size format to Auto.
Size searches will generally match what is displayed.



The best option is to specify the range yourself.
eg:
size:300kb..400kb


I have on my TODO list to add support for a +- operator, for example:
size:350kb+-1kb
therube
Posts: 5804
Joined: Thu Sep 03, 2009 6:48 pm

Re: fsize: A more intuitive way to search by displayed/rounded file size

Post by therube »

(

I saw fsize & I'm like, I know fize ;-).

Code: Select all

C:\BIN\DOS>DIR FSIZE.COM

FSIZE    COM              6,352 01/15/1993  0:00a

---

C:\BIN\DOS>FSIZE

PC Magazine FSIZE version 1.0

Usage 1: FSIZE filespec

Lists total size of file(s), actual space occupied, cluster information
and space that would be occupied by the file(s) on various types of disk.

Usage 2: FSIZE filespec d:

As above but specifically lists space that would be occupied by file(s)
if copied to drive d:

---

C:\BIN\DOS>FSIZE FSIZE.COM

      6352 bytes in 1 file
     32768 bytes occupied by file
     26416 bytes used in padding data to 32768-byte clusters

      6656 bytes used if   512-byte clusters (160K 180K 1.2Mb or 1.44Mb floppy)
      7168 bytes used if  1024-byte clusters (320K 360K or 720K floppy)
      8192 bytes used if  2048-byte clusters (typical AT hard disk)
      8192 bytes used if  4096-byte clusters (typical XT hard disk)
      8192 bytes used if  8192-byte clusters (other large hard disk)
     16384 bytes used if 16384-byte clusters (other large hard disk)

)
therube
Posts: 5804
Joined: Thu Sep 03, 2009 6:48 pm

Re: fsize: A more intuitive way to search by displayed/rounded file size

Post by therube »

A bit more on topic...

Sometimes, sets of file sizes, as listed in Everything differ from those same set of file sizes, as listed in CHK Hash Tool.

https://encode.su/threads/1707-CHK-Hash ... #post86079


Granted, not a big deal, but when things do not compare, when they should, or at least to me that they should... I wonder.


Some more recent mis-compares:

Code: Select all

723388109
701583670
680070187	1.96 vs. 1.95 GB

426388071
424487843
416334101	1.18 vs. 1.17 GB

975881315
699180302	1.56 vs. 1.55 GB

528935566
518801713
488081214	1.43 vs. 1.42 GB

851062705
822634259
801622882
799903351
778870507
747260288
712829358
709375128
706322293
622602715
614244021
606599559	8.17 vs. 8.16 GB

290360634
290336356
290268601
287335766
278386772
278158973
277327450
276643768
276126311
273774513
273226281
272273325
272162496
272090643	3.64 vs. 3.63 GB
If you wanted to create specific sized files, you could do something like:

fsutil file createnew <filename> <length>
fsutil file createnew 0dumy.txt 4096, which would create a file "0dumy.txt", 4096 bytes.

or, you could use a utility like, SetFileSize - setting the size of a file.
NotNull
Posts: 5988
Joined: Wed May 24, 2017 9:22 pm

Re: fsize: A more intuitive way to search by displayed/rounded file size

Post by NotNull »

maznar wrote: Wed Jul 29, 2026 11:22 pm Here's an fsize: filter expression I put together with the help of ChatGPT 5.6 Sol:
[...]
First of all: I'm impressed that it can handle the quite new and rather complex Everything sytnax and come up with a valid answer.
Not too long ago (3 years apparently), ChatGPT even tripped over straightforward regex question (link)


The following should give comparable results.
It allows an "error" margin of 25%. So searching for fsize:100k reports files/folders between 75k and 125k
Change those number (0.75 and 1.25) to change the margin.


To "install":
  • Make sure your current fsize macro/filter is no longer enabled.
  • Type or paste the following in the search bar:

    Code: Select all

    /define fsize=size:[regexreplace:$param:,^(\d+),0.75*$1]".."[regexreplace:$param:,^(\d+),1.25*$1]
  • Press ENTER
    (the statusbar will show fsize=... for a couple of seconds if successful)

To "uninstall":
  • Type or paste the following in the search bar:

    Code: Select all

    /undef fsize
  • Press ENTER
    (the statusbar will show fsize undefined for a couple of seconds)