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

32
LINES

< > BotCompany Repo | #1018960 // JavaX Directory Sizes [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (15423L/108K).

1  
!7
2  
3  
sclass DirInfo {
4  
  File file;
5  
  long size;
6  
}
7  
8  
module JavaXDirSizes extends DynObjectTable<DirInfo> {
9  
  start {
10  
    itemToMap = func(DirInfo d) -> Map {
11  
      litorderedmap(
12  
        Directory := f2s(d.file),
13  
        "Size" := str_toM_questionMarkIfBelowZero(d.size))
14  
    };
15  
    
16  
    // wait 10 seconds if booting, then every 10 minutes
17  
    doEvery(dm_osStarting() ? 10.0 : 0.0, 600.0, r calcIt);
18  
  }
19  
  
20  
  void calcIt {
21  
    temp enter();
22  
    new L<DirInfo> l;
23  
    time "Calculate Dir Sizes" {
24  
      for (File dir : allJavaXDirectories()) {
25  
        long size = -1;
26  
        pcall { size = guessClusteredDirSize(dir); }
27  
        l.add(nu(DirInfo, file := dir, +size));
28  
      }
29  
    }
30  
    setData(sortedByFieldDesc('size, l));
31  
  }
32  
}

Author comment

Began life as a copy of #1018937

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1018960
Snippet name: JavaX Directory Sizes [Dyn Module]
Eternal ID of this version: #1018960/5
Text MD5: ceecd8f07ee9760c2109845dac22299e
Transpilation MD5: fef7a88950eddab9c2aaa04635280ca1
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-18 14:03:28
Source code size: 759 bytes / 32 lines
Pitched / IR pitched: No / No
Views / Downloads: 270 / 1219
Version history: 4 change(s)
Referenced in: [show references]