1 | !636 |
2 | |
3 | main {
|
4 | static List<String> names; |
5 | static List<Boolean> isDirectory; |
6 | |
7 | psvm {
|
8 | String dirToList = System.getProperty("user.home");
|
9 | names = new ArrayList<String>(); |
10 | isDirectory = new ArrayList<Boolean>(); |
11 | File d = new File(dirToList); |
12 | if (d.isDirectory()) {
|
13 | for (File f : d.listFiles()) {
|
14 | boolean isDir = f.isDirectory(); |
15 | names.add(f.getName()); |
16 | isDirectory.add(isDir); |
17 | System.out.println((isDir ? "D" : "F") + " " + f.getName()); |
18 | } |
19 | } |
20 | System.out.println("Count: " + names.size());
|
21 | } |
22 | } |
Began life as a copy of #638
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, qbtsjoyahagl, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
| Snippet ID: | #650 |
| Snippet name: | Store home directory listing (developing, needs persistence) |
| Eternal ID of this version: | #650/1 |
| Text MD5: | 777d0ce0e711c24d1d25b3bc59c64271 |
| Author: | stefan |
| Category: | |
| Type: | JavaX source code |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2015-06-27 15:19:45 |
| Source code size: | 589 bytes / 22 lines |
| Pitched / IR pitched: | No / Yes |
| Views / Downloads: | 940 / 858 |
| Referenced in: | [show references] |