Browse Source

- fixed small bugs in php.io.File, added getc method

Franco Ponticelli 15 years ago
parent
commit
62e558fe96
1 changed files with 7 additions and 6 deletions
  1. 7 6
      std/php/io/File.hx

+ 7 - 6
std/php/io/File.hx

@@ -71,16 +71,17 @@ class File {
 	}
 	}
 
 
 	public static function stdout() {
 	public static function stdout() {
-		return new FileOutput(untyped __call__('STDOUT'));
+		return new FileOutput(untyped __php__('STDOUT'));
 	}
 	}
 
 
 	public static function stderr() {
 	public static function stderr() {
-		return new FileOutput(untyped __call__('STDERR'));
+		return new FileOutput(untyped __php__('STDERR'));
 	}
 	}
-/*
-* TODO: what is this for?
+	
 	public static function getChar( echo : Bool ) : Int {
 	public static function getChar( echo : Bool ) : Int {
-		return getch(echo);
+		var v : Int = untyped __call__("fgetc", __PHP__("STDIN"));
+		if(echo)
+			untyped __call__('echo', v);
+		return v;
 	}
 	}
-*/
 }
 }