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

24
LINES

< > BotCompany Repo | #1021293 // Create a directory

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

Uses 911K of libraries. Click here for Pure Java version (8657L/44K).

1  
!7
2  
3  
cmodule CreateDirectory > DynForm {
4  
  S name, parentDir;
5  
  
6  
  L formParams() {
7  
    ret ll(
8  
      "Directory name", dm_textField('name),
9  
      "Create in", dm_textField('parentDir),
10  
      "", jbutton("Create directory", rThread createIt));
11  
  }
12  
  
13  
  void createIt enter {
14  
    File f = newFile(newFile(parentDir), name);
15  
    if (f.isDirectory())
16  
      ret with infoBox("Directory exists: " + f2s(f));
17  
    if (f.isFile())
18  
      ret with infoBox("It's a file: " + f2s(f));
19  
    mkdirs(f);
20  
    if (f.isDirectory())
21  
      ret with infoBox("Directory created! " + f2s(f));
22  
    infoBox("Couldn't create directory: " + f2s(f));
23  
  }
24  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021293
Snippet name: Create a directory
Eternal ID of this version: #1021293/2
Text MD5: 1118a9d169ed727ad054a6933bddac66
Transpilation MD5: 41c75a99b97557ec4fd9dc1dd61b158f
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: 2019-02-07 13:43:56
Source code size: 649 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 340 / 418
Version history: 1 change(s)
Referenced in: [show references]