rejetto forum

Size of folders

raybob · 3 · 2102

0 Members and 1 Guest are viewing this topic.

Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Would there be any way to implement a native way to get the size of folders?

Both so that A) would display the size of both folders and files on the panel and B) so that the {.filesize.} macro would work with folders also - ex. {.filesize|C:\test\.}



Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
Without big complexity, you can use a combination of a DOS command  (dir c:\test) by getting back the result, by means of the macro {.exec ¦     .}

But the calculation of the size of a directory is always boring and long



Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
this was already discussed in the past, and 1 or 2 solutions were suggested.
Problem is: calculating the size of a folder may take forever, best thing is to pre-calculate and store.
But this sets another problem: keeping the information up to date.
And i'm not even considering the additional problems HFS brings: you can set a filter and hide some files, so when you enter the folder you may not find as many bytes as you showed outside.
I don't have a good solution for this, and until that you won't find an embedded solution.