A tale of two path separators
a day ago
- #file systems
- #macOS
- #path separators
- macOS supports two path separators: slash (/) and colon (:), inherited from Unix (NeXTSTEP) and classic Mac OS (HFS+) respectively.
- File names can appear with slashes or colons depending on the viewing context, such as in Finder versus the ls command.
- The dual separator system persists for backward compatibility, even after the transition to APFS in 2017.
- AppleScript often uses colons as path separators, reflecting its origins in classic Mac OS, but can provide POSIX-style paths when requested.
- The author notes that the variation in path separators is a historical artifact, not a universal standard, with Unix's dominance making alternatives seem unusual.