[squeak-dev] opening a write-only file

David T. Lewis lewis at mail.msen.com
Sat May 31 17:46:23 UTC 2014


On Sat, May 31, 2014 at 10:00:06AM -0700, Douglas McPherson wrote:
> Is there a way to open a write-only file in Squeak? On both Mac and Linux attempting to open such a file fails.
> 
> For example, if you create a write-only file, i.e. in a shell, after cd to default directory
> 
> echo nada > foo
> chmod 200 foo
> 
> Then from Squeak
> 
> StandardFileStream fileNamed: 'foo'
> 
> returns nil.
> 
> If the file is given read permission (i.e. chmod 600 foo) then Squeak can open it.
> 
> Anyone know a workaround?
> 

Sure, you can use FileStream readOnlyFileNamed: 'foo'.

Dave


More information about the Squeak-dev mailing list