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

15
LINES

< > BotCompany Repo | #2000473 // Find old cache files (~.javax)

New Tinybrain snippet

1  
!636
2  
!standard functions
3  
4  
main {
5  
  psvm {
6  
    File javax = new File(System.getProperty("user.home"), ".javax");
7  
    long now = System.currentTimeMillis();
8  
    for (File dir : javax.listFiles()) {
9  
      if (dir.isDirectory() && Pattern.compile("\\d+").matcher(dir.getName()).matches()) {
10  
        Long time = Long.parseLong(dir.getName());
11  
        System.out.println("Age: " + (now-time)); 
12  
      }
13  
    }
14  
  }
15  
}

download  show line numbers   

Snippet is not live.

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

No comments. add comment

Snippet ID: #2000473
Snippet name: Find old cache files (~.javax)
Eternal ID of this version: #2000473/1
Text MD5: 017f09ce9947e7bf41b6f6ee5a4d78df
Author: stefan
Category:
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-07-31 00:50:44
Source code size: 422 bytes / 15 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 601 / 113
Referenced in: [show references]