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)

1  
sS nameRelativeToPhysicalSubdirectory(File inner, File outer) ctex {
2  
  if (inner == null || outer == null) null;
3  
  S path1 = inner.getCanonicalPath();
4  
  S path2a = outer.getCanonicalPath();
5  
  if (eq(path1, path2a)) ret "";
6  
  S path2 = addFileSep(path2a);
7  
  new Matches m;
8  
  if (startsWith(path1, path2, m))
9  
    ret m.rest();
10  
  else
11  
    null;
12  
}

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: 170 / 210
Version history: 5 change(s)
Referenced in: [show references]