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

10
LINES

< > BotCompany Repo | #1025262 // pathRelativeTo (or null) - uses slashes

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

Libraryless. Click here for Pure Java version (2123L/13K).

sS pathRelativeTo(File f, File dir) {
  if (dir == null || f == null) null;
  new LS out;
  do {
    out.add(fileName(f));
    f = dirOfFile(f);
    if (eq(f, dir)) ret joinWithSlash(reversed(out));
  } while (f != null);
  null;
}

Author comment

Began life as a copy of #1022904

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: #1025262
Snippet name: pathRelativeTo (or null) - uses slashes
Eternal ID of this version: #1025262/4
Text MD5: cdd81099b4695c39438eff1b5c94b4ba
Transpilation MD5: a78fd87244fab7c7777b7ef63b255c31
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-17 00:09:19
Source code size: 240 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 149 / 222
Version history: 3 change(s)
Referenced in: [show references]