Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

24
LINES

< > BotCompany Repo | #1002584 // Program Data Sizes (on disk)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2698L/18K/59K).

!752

static int minSizeToShow = 100*1024; // 0.1 MB

answer {
  if "program data sizes" {
    L<File> dirs = allDataDirectories();
    new Map<S, Long> map;
    long total = 0, totalCount = 0;
    for (File dir : dirs) {
      long count = numberOfFiles(dir);
      long size = directorySize(dir);
      total += size;
      totalCount += count;
      S id = dir.getName();
      
      if (size >= minSizeToShow)
        map.put(id + ": " + formatDouble(toM_double(size), 1) + " MB (" + n(count, "file") + ") - " + getSnippetTitle_overBot(id), size);
    }
    ret slackSnippet(
      "Total files: " + totalCount + ", total size: " + formatDouble(toM_double(total), 1) + " MB, showing all programs above " + (minSizeToShow/1024) + " K\n" +
      fromLines(reversedList(keysSortedByValues(map))));
  }
}

Author comment

Began life as a copy of #1002039

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1002584
Snippet name: Program Data Sizes (on disk)
Eternal ID of this version: #1002584/1
Text MD5: 1155c769c579e394442ad246670b5dc8
Transpilation MD5: 23a8c1298891b9b3e999a9c37e5e46f1
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-02-03 01:23:45
Source code size: 828 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 592 / 1014
Referenced in: #1002636 - List All Files - hopefully nothing sensitive in there
#1006536 - Print Sizes Of JavaX Directories
#3000202 - Answer for stefanreich (>> T conversion bot)
#3000203 - Answer for stefanreich (>> timing hello bot)
#3000208 - Answer for bgrgndz (>> list sub bots)
#3000209 - Answer for bgrgndz (>> list sub bots)
#3000238 - Answer for stefanreich (>> t power bot)
#3000369 - Answer for Stefan (>> list sub bots)
#3000376 - Answer for stefanreich (>> list sub bots)
#3000377 - Answer for stefanreich (>> timing eleu?)
#3000380 - Answer for stefanreich (>> list sub bots)
#3000381 - Answer for speedforce (>> list sub bots)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)