develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r34542 - in trunk: examples/pir examples/streams examples/tutorial t/examples

From:
jkeenan
Date:
December 28, 2008 20:21
Subject:
[svn:parrot] r34542 - in trunk: examples/pir examples/streams examples/tutorial t/examples
Message ID:
20081229042138.231EDCB9FA@x12.develooper.com
Author: jkeenan
Date: Sun Dec 28 20:21:37 2008
New Revision: 34542

Modified:
   trunk/examples/pir/io.pir
   trunk/examples/pir/uniq.pir
   trunk/examples/streams/FileLines.pir
   trunk/examples/streams/ParrotIO.pir
   trunk/examples/tutorial/40_file_ops.pir
   trunk/t/examples/streams.t

Log:
Fix PIR used in 'make examples_tests' to reflect discontinuation of certain open modes.  Patch courtesy of Geraud Continsouzas.

Modified: trunk/examples/pir/io.pir
==============================================================================
--- trunk/examples/pir/io.pir	(original)
+++ trunk/examples/pir/io.pir	Sun Dec 28 20:21:37 2008
@@ -20,7 +20,7 @@
 .sub 'example' :main
     .local string test_fn
     test_fn = "tmp_example_io.tmp"
-    $P0 = open test_fn, ">"
+    $P0 = open test_fn, 'w'
     seek $P0, 300, 0
     # 64bit version of seek with high 32bits = 0
     #seek $IO, $P0, 0, 400, 0
@@ -32,7 +32,7 @@
     print $P0, "test5\n"
     close $P0
 
-    $P0 = open test_fn, "<"
+    $P0 = open test_fn, 'r'
     $S0 = read $P0, 1024
     print $S0
 

Modified: trunk/examples/pir/uniq.pir
==============================================================================
--- trunk/examples/pir/uniq.pir	(original)
+++ trunk/examples/pir/uniq.pir	Sun Dec 28 20:21:37 2008
@@ -84,7 +84,7 @@
 
   $I1 = 1 # count
   .local pmc in_fh
-  in_fh = open file_name, "<"
+  in_fh = open file_name, 'r'
   unless in_fh, ERR
   .local string prev_line, curr_line
   prev_line = readline in_fh

Modified: trunk/examples/streams/FileLines.pir
==============================================================================
--- trunk/examples/streams/FileLines.pir	(original)
+++ trunk/examples/streams/FileLines.pir	Sun Dec 28 20:21:37 2008
@@ -40,7 +40,7 @@
 
     # create a file stream
     file = new "Stream::ParrotIO"
-    file."open"( name, "<" )
+    file."open"( name, 'r' )
 
     # process it one line per read
     lines = new "Stream::Lines"

Modified: trunk/examples/streams/ParrotIO.pir
==============================================================================
--- trunk/examples/streams/ParrotIO.pir	(original)
+++ trunk/examples/streams/ParrotIO.pir	Sun Dec 28 20:21:37 2008
@@ -25,7 +25,7 @@
     stream = new "Stream::ParrotIO"
 
     # open this file
-    stream."open"( "examples/streams/ParrotIO.pir", "<" )
+    stream."open"( "examples/streams/ParrotIO.pir", 'r' )
 
     # you can specifiy a custom block size with
     # stream."blockSize"( 10 )

Modified: trunk/examples/tutorial/40_file_ops.pir
==============================================================================
--- trunk/examples/tutorial/40_file_ops.pir	(original)
+++ trunk/examples/tutorial/40_file_ops.pir	Sun Dec 28 20:21:37 2008
@@ -7,11 +7,11 @@
 .sub main :main
     .local pmc fileout, filein
 
-    fileout = open "40_file_ops_data.txt", ">"
+    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", "<"
+    filein = open "40_file_ops_data.txt", 'r'
     $S0 = readline filein
     say $S0
     close filein

Modified: trunk/t/examples/streams.t
==============================================================================
--- trunk/t/examples/streams.t	(original)
+++ trunk/t/examples/streams.t	Sun Dec 28 20:21:37 2008
@@ -162,7 +162,7 @@
 read:[   40 ]
 read:[   41     # create a file stream]
 read:[   42     file = new "Stream::ParrotIO"]
-read:[   43     file."open"( name, "<" )]
+read:[   43     file."open"( name, 'r' )]
 read:[   44 ]
 read:[   45     # process it one line per read]
 read:[   46     lines = new "Stream::Lines"]
@@ -245,7 +245,7 @@
 read:[de "library/Stream/ParrotIO.pir"\n\n    # create the]
 read:[ ParrotIO stream\n    stream = new "Stream::ParrotI]
 read:[O"\n\n    # open this file\n    stream."open"( "examp]
-read:[les/streams/ParrotIO.pir", "<" )\n\n    # you can sp]
+read:[les/streams/ParrotIO.pir", 'r' )\n\n    # you can sp]
 read:[ecifiy a custom block size with\n    # stream."bloc]
 read:[kSize"( 10 )\n\n    # dump the stream\n    stream."du]
 read:[mp"()\n\n    end\n.end\n\n=head1 AUTHOR\n\nJens Rieks E<l]



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About