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

12
LINES

< > BotCompany Repo | #638 // List current directory (works, shows "D" or "F" and name)

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

Libraryless. Click here for Pure Java version (28L/1K/2K).

!636
!main
!auto-import

String dirToList = ".";
File d = new File(dirToList);
if (d.isDirectory()) {
  for (File f : d.listFiles()) {
    boolean isDir = f.isDirectory();
    System.out.println((isDir ? "D" : "F") + " " + f.getName());
  }
}

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: #638
Snippet name: List current directory (works, shows "D" or "F" and name)
Eternal ID of this version: #638/1
Text MD5: a84217eecf28ec0405cd2bdd3c3b212c
Transpilation MD5: 74d349a08428dad35411ff5c2b7da453
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-24 15:08:33
Source code size: 253 bytes / 12 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 681 / 615
Referenced in: [show references]