RFD: Use of ~ (tilde) when considering local and non-local file URLs

Eirik Bjørsnøs eirbjo at gmail.com
Thu Mar 27 16:25:53 UTC 2025


On Thu, Mar 27, 2025 at 3:03 PM Jaikiran Pai <jai.forums2013 at gmail.com>
wrote:

> Hello Eirik,
>
> The code in URLJarFile which does that check for "~" seems to have been
> introduced for https://bugs.openjdk.org/browse/JDK-4447921. It doesn't
> tell why the "~" was necessary.
>

Similar to the Unix history of using "~" as a substitution for home
directories [1], perhaps the "Home" button on the Lear-Siegler ADM-3A
terminal also inspired use of "~" to signify the "Home" host, a.k.a
'localhost' on some platform historically supported by the JDK?

Currently, the JDK resolves both these URLs on unixes:

file://localhost/etc/hosts
file://~/etc/hosts

while the latter is rejected by curl (MacOS) as a "Bad file:// URL".

Any AIX or Solaris/SunOS historians here?

Eirik.

[1] https://en.wikipedia.org/wiki/Tilde#Directories_and_URLs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/net-dev/attachments/20250327/ccf3208d/attachment.htm>


More information about the net-dev mailing list