Index: src/builtins/io.pir
===================================================================
--- src/builtins/io.pir	(revision 29560)
+++ src/builtins/io.pir	(working copy)
@@ -35,6 +35,24 @@
 .end
 
 
+=item printf
+
+Parses a format string and prints formatted output according to it.
+
+=cut
+
+.sub 'printf' :method
+    .param pmc args            :slurpy
+
+    args.'!flatten'()
+    $P0 = new 'Str'
+    sprintf $P0, self, args
+
+    print $P0
+    .return (1)
+.end
+
+
 .sub 'use'
     .param pmc module
     .param pmc args :slurpy
Index: src/classes/IO.pir
===================================================================
--- src/classes/IO.pir	(revision 29560)
+++ src/classes/IO.pir	(working copy)
@@ -62,6 +62,26 @@
 .end
 
 
+=item printf
+
+Parses a format string and prints formatted output according to it.
+
+=cut
+
+.sub 'printf' :method
+    .param pmc args            :slurpy
+    .local pmc PIO
+    PIO = getattribute self, "$!PIO"
+
+    args.'!flatten'()
+    $P0 = new 'Str'
+    sprintf $P0, self, args
+
+    print PIO, $P0
+    .return (1)
+.end
+
+
 =item readline
 
 Reads a line from the file handle.
