[Cuis-dev] FileEntry fileContents hangs on macOS Alias file

Juan Vuletich juan at cuis.st
Wed Aug 13 11:22:54 PDT 2025


Hi Bernhard,

On 05/08/2025 6:15 PM, Bernhard Pieber via Cuis-dev wrote:
> Hi,
>
> I tripped over a macOS alias file which has only 1172 bytes but whose contents cannot be shown in a file list in the latest Cuis7.5-7384.image. The cursor turns into an hourglass and I need to interrupt Cuis with Cmd-Dot.
>
> I attached a zipped directory with the bad file and a good alias file to compare. To reproduce do:
>
> (DirectoryEntry userBaseDirectory / 'alias_test' // 'good') fileContents size. 1222 .
> (DirectoryEntry userBaseDirectory / 'alias_test' // 'bad') fileContents size. „hangs"
>
> Is this a bug or a feature?
>
> If I use binaryContents it does not hang but answers a size of 0 which also seems false to me as the file contains 1172 bytes. How can I get those into a ByteArray?
>
> (DirectoryEntry userBaseDirectory / 'alias_test' // 'good') binaryContents size. 1228 .
> (DirectoryEntry userBaseDirectory / 'alias_test' // 'bad') binaryContents size. 0.
>
> I could reproduce it on another Mac.
>
> Cheers,
> Bernhard


I unzipped your file on my Mac and tried. If I open Mac Finder on the 
folder, and ask for 'Get Info' on them, I get:

'good'. Kind: Document. Size: 1228 bytes.

'bad'. Kind: Alias. Size: 1172 btytes. Original: 
/Users/bernhard/Dropbox/......./....rtfd

So, the 'good' is a regular file, not an alias. 'bad' is an alias, and 
the original file is not available in my system (making it a broken alias).

I don't see any crash, but trying to open 'bad'(with #fileContents or 
#binaryContents) results in a "bad does not exist" message. If I create 
an alias to a file that does exist, I get the contents of the file, even 
when if I open Terminal and do `more aliasAjuan1.txt` I get the binary 
encoding of the alias, and not the contents of the referenced file 
('juan1.txt').

So, if there is a problem in your system, I could not reproduce it. What 
I see looks quite reasonable for me.

HTH,

-- 
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich



More information about the Cuis-dev mailing list