Libraryless. Click here for Pure Java version (2123L/13K).
1 | sS pathRelativeTo(File f, File dir) { |
2 | if (dir == null || f == null) null; |
3 | new LS out; |
4 | do { |
5 | out.add(fileName(f)); |
6 | f = dirOfFile(f); |
7 | if (eq(f, dir)) ret joinWithSlash(reversed(out)); |
8 | } while (f != null); |
9 | null; |
10 | } |
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: | 230 / 322 |
Version history: | 3 change(s) |
Referenced in: | [show references] |