Author: coke
Date: Tue Dec 30 16:32:52 2008
New Revision: 34680
Modified:
trunk/examples/tutorial/40_file_ops.pir
trunk/t/examples/tutorial.t
Log:
Instead of cleaning up quietly after the tutorial, encourage new developers to DTRT.
Modified: trunk/examples/tutorial/40_file_ops.pir
==============================================================================
--- trunk/examples/tutorial/40_file_ops.pir (original)
+++ trunk/examples/tutorial/40_file_ops.pir Tue Dec 30 16:32:52 2008
@@ -7,15 +7,18 @@
.sub main :main
.local pmc fileout, filein
- fileout = open "40_file_ops_data.txt", 'w'
+ fileout = open '40_file_ops_data.txt', 'w'
print fileout, "The quick brown fox jumps over the lazy dog.\n"
close fileout
- filein = open "40_file_ops_data.txt", 'r'
+ filein = open '40_file_ops_data.txt', 'r'
$S0 = readline filein
say $S0
close filein
+ # Be nice and remove the temporary file we created.
+ $P1 = new 'OS'
+ $P1.'rm'('40_file_ops_data.txt')
.end
# Local Variables:
Modified: trunk/t/examples/tutorial.t
==============================================================================
--- trunk/t/examples/tutorial.t (original)
+++ trunk/t/examples/tutorial.t Tue Dec 30 16:32:52 2008
@@ -249,15 +249,6 @@
}
}
-
-
-# cleanup
-{
-
- # The example '40_file_ops.pir' leave a temporary file.
- unlink '40_file_ops_data.txt';
-}
-
# Local Variables:
# mode: cperl
# cperl-indent-level: 4