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

16
LINES

< > BotCompany Repo | #1016098 // conceptBackupFiles

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5558L/31K).

1  
// sorted by descending date
2  
static L<File> conceptBackupFiles(S progID) {
3  
  ret conceptBackupFiles(programDir(progID));
4  
}
5  
6  
static L<File> conceptBackupFiles(File dir) {
7  
  S regexp = "^(.*)\\.backup(20\\d\\d)(\\d\\d)(\\d\\d)-(\\d+)$";
8  
  new L<File> l;
9  
  for (File f : listFilesNotDirs(dir, newFile(dir, "backups"))) {
10  
    S s = f.getName();
11  
    S originalName = regexpFirstGroup(regexp, s);
12  
    continue unless eq(originalName, "concepts.structure.gz");
13  
    l.add(f);
14  
  }
15  
  ret sortFilesByNameDesc(l);
16  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016098
Snippet name: conceptBackupFiles
Eternal ID of this version: #1016098/6
Text MD5: fea15582e5737e6d40f43367f26f7569
Transpilation MD5: ae372899a6033b5307594a855e822542
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-31 20:01:07
Source code size: 518 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 455 / 599
Version history: 5 change(s)
Referenced in: [show references]