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

12
LINES

< > BotCompany Repo | #1032129 // nameRelativeToPhysicalSubdirectory (null if not applicable; uses platform file sep)

JavaX fragment (include)

sS nameRelativeToPhysicalSubdirectory(File inner, File outer) ctex {
  if (inner == null || outer == null) null;
  S path1 = inner.getCanonicalPath();
  S path2a = outer.getCanonicalPath();
  if (eq(path1, path2a)) ret "";
  S path2 = addFileSep(path2a);
  new Matches m;
  if (startsWith(path1, path2, m))
    ret m.rest();
  else
    null;
}

Author comment

Began life as a copy of #1024335

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032129
Snippet name: nameRelativeToPhysicalSubdirectory (null if not applicable; uses platform file sep)
Eternal ID of this version: #1032129/6
Text MD5: 6595dc96a1e9f53f9acd1f1c06dbce6e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-01 21:14:37
Source code size: 354 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 169 / 208
Version history: 5 change(s)
Referenced in: [show references]