Libraryless. Click here for Pure Java version (2698L/18K/59K).
1 | !752 |
2 | |
3 | static int minSizeToShow = 100*1024; // 0.1 MB |
4 | |
5 | answer { |
6 | if "program data sizes" { |
7 | L<File> dirs = allDataDirectories(); |
8 | new Map<S, Long> map; |
9 | long total = 0, totalCount = 0; |
10 | for (File dir : dirs) { |
11 | long count = numberOfFiles(dir); |
12 | long size = directorySize(dir); |
13 | total += size; |
14 | totalCount += count; |
15 | S id = dir.getName(); |
16 | |
17 | if (size >= minSizeToShow) |
18 | map.put(id + ": " + formatDouble(toM_double(size), 1) + " MB (" + n(count, "file") + ") - " + getSnippetTitle_overBot(id), size); |
19 | } |
20 | ret slackSnippet( |
21 | "Total files: " + totalCount + ", total size: " + formatDouble(toM_double(total), 1) + " MB, showing all programs above " + (minSizeToShow/1024) + " K\n" + |
22 | fromLines(reversedList(keysSortedByValues(map)))); |
23 | } |
24 | } |
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: | 659 / 1101 |
Referenced in: | [show references] |