<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"/></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi,<div><br/></div><div>In macOS Finder it is possible to create directories and file names which contain forward slashes. I created a directory named a/b with a file named b/c. Under the hood the slash is converted to a colon, e.g.</div><div><p style="margin: 0px; font-style: normal; font-variant-caps: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-position: normal; font-variant-emoji: normal; font-feature-settings: normal; font-optical-sizing: auto; font-variation-settings: normal;"><span style="font-variant-ligatures: no-common-ligatures">bernhard@MacBookPro16 Cuis-Smalltalk-Dev % find . -name b:c</span></p>
<p style="margin: 0px; font-style: normal; font-variant-caps: normal; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; font-size-adjust: none; font-kerning: auto; font-variant-alternates: normal; font-variant-ligatures: normal; font-variant-numeric: normal; font-variant-east-asian: normal; font-variant-position: normal; font-variant-emoji: normal; font-feature-settings: normal; font-optical-sizing: auto; font-variation-settings: normal;"><span style="font-variant-ligatures: no-common-ligatures">./a:b/b:c</span></p></div><div><br/></div><div>See also <a href="https://stackoverflow.com/questions/13298434/colon-appears-as-forward-slash-when-creating-file-name">https://stackoverflow.com/questions/13298434/colon-appears-as-forward-slash-when-creating-file-name</a></div><div><br/></div><div><span style="font-variant-ligatures: no-common-ligatures">In Cuis the names are shown with colons as well. The following expression answers true:</span></div><div><span style="font-variant-ligatures: no-common-ligatures">(DirectoryEntry vmDirectory directoryMatching: 'a:b') exists. „true“</span></div><div><span style="font-variant-ligatures: no-common-ligatures"><br/></span></div><div><span style="font-variant-ligatures: no-common-ligatures">However, the following expression answers false:</span></div><div><span style="font-variant-ligatures: no-common-ligatures">(DirectoryEntry vmDirectory / 'a:b') exists.</span></div><div><span style="font-variant-ligatures: no-common-ligatures"><br/></span></div><div>The reason for this is that on macOS the colon is not a separator – it was in Classic Mac OS, while Cuis assumes it still is, see String class>>#pathSeparators:</div><div><br/></div><div>pathSeparators</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>^'\:/'</div><div><span style="font-variant-ligatures: no-common-ligatures"><br/></span></div><div>Seeing this implementation made me realize the same problem exists for directory and file names including a backslash. While I can create them in Finder, Cuis does not fully support them.</div><div><span style="font-variant-ligatures: no-common-ligatures"><br/></span></div><div><span style="font-variant-ligatures: no-common-ligatures">Creating such directories fails as well:</span></div><div><span style="font-variant-ligatures: no-common-ligatures"><div>DirectoryEntry vmDirectory assureExistenceDirNamed: 'bin:go'.</div><div>DirectoryEntry vmDirectory assureExistenceDirNamed: 'bin\go‘.</div><div><br/></div><div>Interestingly, using SqueakCompatibility the following works:</div><div><div>(FileDirectory on: '/Users/bernhard/Entwicklung/Cuis/Cuis-Smalltalk/Cuis-Smalltalk-Dev') createDirectory: 'bin:go'.</div><div>(FileDirectory on: '/Users/bernhard/Entwicklung/Cuis/Cuis-Smalltalk/Cuis-Smalltalk-Dev') createDirectory: 'bin\go‘.</div></div><div><br/></div><div>The best fix would probably be to make the path separator platform dependent. (However, given that Smalltalk platformName returns 'Mac OS' even on macOS, I am not sure how best to distinguish between Classic Mac OS and macOS.)</div><div><br/></div><div>Cheers,</div><div>Bernhard</div></span></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div><div><br/></div></body></html>