
8 Jan
2021
8 Jan
'21
10:25 a.m.
| From: D. Hugh Redelmeier via talk <talk@gtalug.org> | Since, in practice, URLs seem to always contain "/", and filenames do | not, that would be a better way to distinguish them. Duh, Hugh. filenames don't contain / but pathnames do. It actually takes a pathname or a URL. Here are some strategies that I like better. URLs match protocolname:/ ... where protocolname is a sequence of letters or digits, as far as I know. So: if it looks like a URL, try it as a URL OR: if protocolname matches a known collection of supported protocols, try it as a URL. OR: try operand as a pathname; if that fails, try it as a URL. OR: if it looks like a URL, try it as a URL; if that fails, try it as a pathname.