Skip to main content
1 of 3
Allan
  • 104.4k
  • 33
  • 206
  • 470

I'm guessing that open thinks that the filename might be a URL.

You would be correct. Unix/BSD/Linux/etc. (macOS is a certified Unix) don’t use characters for filenames. Instead, it’s an array of bytes. With the exception of a few characters like the Null character (0x00) and forward slash (0x2f - /) pretty much everything else is fair game including colons.

Is there some way to force open to open the file by default if the file exists,

Unfortunately, no. Your operating system (macOS in this case) cannot tell the difference between a filename with a colon or a URL with a colon.

Why?

The problem here is that per the URL Specification (RFC-1738), §2.1, The main parts of URLs define what a URL is supposed to look like…

A URL contains the name of the scheme being used () followed by a colon and then a string (the ) whose interpretation depends on the scheme.

Emphasis Mine

Allan
  • 104.4k
  • 33
  • 206
  • 470