petdance/scratch — Issue #431: FileHandles aren't flushed and closed on program exit
Author: petdance
Created: 2011-11-01 05:42:19+00:00
State: open
Labels: bug, core, Pri-normal, Sev-medium

From discussion in parrot-dev, FileHandles are not automatically flushed and closed upon program exit.
{{{
pmichaud at kiwi:~/nom$ cat fh.pir
.sub 'main' :main
$P0 = new ['FileHandle']
$P1 = $P0.'open'('test.txt', 'w')
$P1.'print'("Hello\n")
.end

pmichaud at kiwi:~/nom$ install/bin/parrot fh.pir
pmichaud at kiwi:~/nom$ cat test.txt
pmichaud at kiwi:~/nom$ ls -l test.txt
-rw-r--r-- 1 pmichaud pmichaud 0 2011-07-17 09:57 test.txt
}}}

See the thread at http://lists.parrot.org/pipermail/parrot-dev/2011-July/006013.html .

Pm

Originally http://trac.parrot.org/parrot/ticket/2157