[squeak-dev] opening a write-only file

Douglas McPherson djm1329 at san.rr.com
Sat May 31 21:45:10 UTC 2014


Ahh, thanks. I'll try it out when back in front of my machine.

Thanks,
Doug

Sent from my iPhone

> On May 31, 2014, at 14:23, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> 
> Hi Doug,
> 
> 
>> On Sat, May 31, 2014 at 10:00 AM, Douglas McPherson <djm1329 at san.rr.com> 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.
> 
> Squeak has forceNewFileNamed: & forceNewFileNamed:do:.  If you look at sqFileOpen in platforms/Cross/plugins/FilePlugin/sqFilePluginBasicPrims.c you'll see it first attempts to open read-write and if that fails, opens write-only.  So it should work.
> 
> HTH
> 
>> 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?
>> 
>> Thanks,
>> Doug
> 
> 
> -- 
> best,
> Eliot
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20140531/bbd4acd9/attachment.htm


More information about the Squeak-dev mailing list