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

24
LINES

< > BotCompany Repo | #1001059 // Clear data directory of a program

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

Libraryless. Click here for Pure Java version (114L/1K/4K).

!747

m {
  static S snippetID = "#1001048"; // just a test program
  static boolean testRun;
 
  p {
    for (S arg: args)
      if (arg.equals("-test")) testRun = true;
    else
      snippetID = arg;
    
    File dir = programDir(snippetID);
    print("Clearing: " + dir);
    
    deleteDirectory(dir, true, testRun);
    
    if (!testRun)
      if (dir.exists())
        print("Problem? Directory still exists.");
      else
        print("Done, ok, directory gone. Hopefully it wasn't important!");
  }
}

Author comment

Began life as a copy of #1001050

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001059
Snippet name: Clear data directory of a program
Eternal ID of this version: #1001059/1
Text MD5: 421c12af86a839b44c921d153302786d
Transpilation MD5: 5d2801dc7b286a29590863963eb2f523
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-18 19:50:58
Source code size: 535 bytes / 24 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 655 / 725
Referenced in: [show references]