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

8
LINES

< > BotCompany Repo | #1001459 // listFiles (plus dirs, doesn't recurse)

JavaX fragment (include)

static File[] listFiles(File dir) {
  File[] files = dir == null ?: dir.listFiles();
  return files == null ? new File[0] : files;
}

static File[] listFiles(S dir) {
  ret listFiles(new File(dir));
}

download  show line numbers  debug dex  old transpilations   

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

Comments [hide]

ID Author/Program Comment Date
1129 stefan Actually lists files and directories, just like File.listFiles() 2015-10-16 20:58:25

add comment

Snippet ID: #1001459
Snippet name: listFiles (plus dirs, doesn't recurse)
Eternal ID of this version: #1001459/3
Text MD5: 78e6dff2176cc2fadfaf2930282eee32
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-11 22:49:13
Source code size: 207 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 1037 / 1434
Version history: 2 change(s)
Referenced in: #1001461 - listDirs (only first level)
#1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1011851 - listProgramFiles
#1019114 - listImageFiles - doesn't recurse
#1020505 - listFileNamesPlusSomeInfo_1 - name plus size (size = -1 if directory)
#3000382 - Answer for ferdie (>> t = 1, f = 0)