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

10
LINES

< > BotCompany Repo | #1025330 // findFileWithSameContents (in same directory)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2425L/15K).

static File findFileWithSameContents(S path) {
  ret findFileWithSameContents(newFile(path));
}

static File findFileWithSameContents(File f) {
  for ping (File f2 : listFilesOnly(dirOfFile_orDot(f)))
    if (!isSameFile(f, f2) && filesHaveSameContents(f, f2))
      ret f2;
  null;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1025330
Snippet name: findFileWithSameContents (in same directory)
Eternal ID of this version: #1025330/3
Text MD5: 63aa131c7833d7cf951dd4368f8aedd6
Transpilation MD5: 60e8e5903a240d2c0269a4facbe95232
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-23 13:38:35
Source code size: 293 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 121 / 186
Version history: 2 change(s)
Referenced in: [show references]