Not sure if this is a bug or not, but I noticed that the open opcode
creates its argument if the desired file doesn't exist. Here's a test
case:
.sub main :main
.param pmc args
.local pmc file
$S0 = shift args # script name
$S0 = shift args # first argument
file = open $S0
end
.end
Run as "parrot test.pir <filename>". If filename doesn't exist, it
will be created.
BTW, this is my first PIR script, so please be gentle :)
Regards,
Jonathan Rockway
So, I think this is not a bug - yes, we could argue all day about what
the default open mode should be, but there's a perfectly good way to be
explicit about you want that's only a few characters to type. :-)
Jonathan