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

[svn:parrot] r33846 - trunk/src/pmc

From:
fperrad
Date:
December 13, 2008 00:59
Subject:
[svn:parrot] r33846 - trunk/src/pmc
Message ID:
20081213085905.90476CB9AF@x12.develooper.com
Author: fperrad
Date: Sat Dec 13 00:59:00 2008
New Revision: 33846

Modified:
   trunk/src/pmc/filehandle.pmc

Log:
[pdd22io] 
Add the method 'isatty' (lost between ParrotIO and FileHandle)
The Lua interpreter needs it.



Modified: trunk/src/pmc/filehandle.pmc
==============================================================================
--- trunk/src/pmc/filehandle.pmc	(original)
+++ trunk/src/pmc/filehandle.pmc	Sat Dec 13 00:59:00 2008
@@ -228,6 +228,18 @@
 
 /*
 
+=item C<METHOD isatty()>
+
+=cut
+
+*/
+    METHOD isatty() {
+        INTVAL isatty = (PARROT_FILEHANDLE(SELF)->flags & PIO_F_CONSOLE) == PIO_F_CONSOLE;
+        RETURN(INTVAL isatty);
+    }
+
+/*
+
 =item C<METHOD close()>
 
 Close the filehandle.



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