squeak-smalltalk / squeak-object-memory

Issues and assets related to the Squeak object memory.
https://bugs.squeak.org
MIT License
11 stars 1 forks source link

`Installer class>>#file:` happily accepts a directory, but cannot handle it #33

Open tcj opened 2 years ago

tcj commented 2 years ago

Squeak6.0beta-21829-64bit / macOS

I understand, merely from reading the code, that this wants a file, but perhaps some safety can be built in here to not try to read a directory as if it were a file. Or, when it does, not to go into what seems like an infinite loop.

(Installer file: '/Users/tcj/src/metacello/repository')
    install

shows:

Screen Shot 2022-05-29 at 8 12 14 AM

...and then goes into a seemingly endless loop...

ByteString(String)>>indexOf:startingAt:
MultiByteFileStream>>basicSkipTo:
MultiByteFileStream>>basicUpTo:
[] in UTF8TextConverter>>nextChunkFromStream:
String class(SequenceableCollection class)>>new:streamContents:
UTF8TextConverter>>nextChunkFromStream:
MultiByteFileStream>>nextChunk
[] in [] in [] in MultiByteFileStream(PositionableStream)>>fileInFor:announcing:
FullBlockClosure(BlockClosure)>>on:do:
[] in [] in MultiByteFileStream(PositionableStream)>>fileInFor:announcing:
FullBlockClosure(BlockClosure)>>on:do:
[] in MultiByteFileStream(PositionableStream)>>fileInFor:announcing:
[] in [] in MorphicUIManager>>displayProgress:at:from:to:during:
FullBlockClosure(BlockClosure)>>on:do:
[] in MorphicUIManager>>displayProgress:at:from:to:during:
FullBlockClosure(BlockClosure)>>ensure:
MorphicUIManager>>displayProgress:at:from:to:during:
ProgressInitiationException>>defaultResumeValue
ProgressInitiationException(Exception)>>resume
ProgressInitiationException>>defaultAction
marceltaeumel commented 2 years ago

This is interesting. On Windows, I get a does-not-exist error. So, why is macOS not failing for an attempt like this:

FileStream concreteStream readOnlyFileNamed: '/Users/tcj/src/metacello/repository'

Hmm....

tcj commented 2 years ago

FileStream concreteStream readOnlyFileNamed: '/Users/tcj/src/metacello/repository' also does not fail on 5.3:

Screen Shot 2022-06-03 at 9 07 39 AM

I wonder if Squeak on macOS has always allowed attempting to open a directory as a file?