Windows handles slash as well, also part of a unification with UNIX style paths intended for XEDOS.
Double colon (::) meant the same as .. on Unix/DOS, that is "go up one level". So you have to be careful when concatenating paths to not get double separators.
Paths starting with : were relative. If a path didn't start with the separator, the first component was the volume name (disk partition). Again, quite unlike Unix.
Also, remember it was common to have spaces in names on Mac, even the default harddrive on Macs was named "Macintosh HD". So an absolute path like "Macintosh HD:Programs:MacWrite" would have been common. (I grew up with Macs in Swedish, so I'm back translating the names here, could be that the names were slightly different in English.)
$ cat <<'EOF' >x.lisp
heredoc> (require :uiop)
heredoc> (let ((p (make-pathname :name "foo:bar")))
heredoc> (format t "~@{~A~%~}" (namestring p) (uiop:native-namestring p)))
heredoc> EOF
$ ccl -b -Q -l x.lisp </dev/null
foo\:bar
foo:bar
$ sbcl --script x.lisp
foo:bar
foo:bar(Other characters of course cause usability problems and are potentially even a security vulnerability depending on the terminal. But they're still "valid".)
C:\WINDOWS\system32>cd D:\backups\some-huge-directory
C:\WINDOWS\system32>del /s *
Oops. I learned to look twice before running a big dangerous command. And to use /d.VMS used:
node::device:[dir1.dir2.dir3]filename.extension;version
from memory, you could have up to 15 nested directories.The versioning was cool as long as you remembered to clean them up.
$ touch "foo:bar"
In the Terminal, then Finder renders it as foo/bar.So who is lying, how is it stored in the directory entry in APFS itself?
macOS supports case-insensitivity[0] and performs unicode normalization[1] on filenames, and decomposes name data to an extent that the question "what does the fs see" is a bit moot.
With that said, the internal storage of filenames in APFS are a nul-terminated UTF-8 string[2], with (i'm pretty sure) colons as colons, which the Finder displays as slashes.
[0] if you make a file named "Makefile" then touch a file named "makefile", it'll touch the first file, instead of making a second file.
[1] if you make a file named "schön" (s-c-h-combining¨-o-n) and then search for (s-c-h-ö-n), you can find it, or vice versa. The particular normalization/canonicalization used is NFD.
[2] j_drec_key_t description in https://developer.apple.com/support/downloads/Apple-File-Sys...
Combining marks come after the character they modify, btw. (Presumably thanks to support from things like harfbuzz, modern systems will happily put two dots above an h.)
I was reminded yesterday that macOS will happily let you create files that appear to have slashes in their name, as shown here by the Finder:

I made the folder with the “New Folder” button in Finder, and the text file by saving it in TextEdit. Even though I understand how this works, it breaks my brain a bit every time.
If you didn’t know how this works, you could get a clue by running ls:
$ ls
a:b:c/ x:y:z.txt
The files have either colons or slashes in their name, depending on how you look at them.
I don’t understand all the nuances, but I know this is a side-effect of the fact that macOS has not one but two path separators: the slash (/) and the colon (:). The two separators are used in different contexts, and the system will translate between them as needed.
These two separators reflect the two parent systems of modern macOS: classic Mac OS and the Unix-like NeXTSTEP. When they were joined together, Apple’s engineers had to build a file system that was compatible with both the classic Mac’s file system (the Mac OS Extended File System, aka HFS+), and with NeXTSTEP’s file system (the Unix file system, aka UFS). Among other differences, these systems had different path separators: HFS+ used a colon, while UFS used a slash.
There’s a Usenix 2000 paper written by several Apple engineers which describes the problems of combining classic Mac OS and Unix in more detail. It actually describes exactly what we’re seeing with the Finder and ls:
[The translation layer] can create a user-visible schizophrenia in the rare cases of file names containing colon characters, which appear to Carbon applications as slash characters, but to BSD programs and Cocoa applications as colons.
AppleScript is where you’re most likely to encounter colons as path separators in modern macOS:
$ which osascript
/usr/bin/osascript
$ osascript -e 'tell application "Finder" to get (path to me)'
alias Phoenix SSD:usr:bin:osascript
This is likely because AppleScript goes back to System 7, which only had to care about HFS+ and colons. It can give you a UNIX- (or POSIX-) style path, but you have to ask for it explicitly:
$ osascript -e 'tell application "Finder" to get POSIX path of (path to me)'
/usr/bin/osascript
In 2017, Apple replaced HFS+ with the Apple File System, aka APFS, but these dual path separators remain. I can’t find any documentation to confirm it, but I assume that’s for backward compatibility reasons – picking a single path separator would break an enormous amount of software.
The “slashes in filenames” breaks my brain because I started programming after Unix-style filesystems had become totally dominant. In my mind, slash is the directory separator, and Windows is weird for using the backwards slash (\). In reality, file systems have used a variety of directory separators, and it’s only the current Unix hegemony that makes this seem weird. On another timeline, forward slashes in a filename would seem totally normal.