|
@@ -54,36 +54,36 @@ extern class Io {
|
|
|
public static function input(file : FileHandle) : Void;
|
|
|
|
|
|
/**
|
|
|
- Opens the given file name in read mode and returns an iterator function that,
|
|
|
- each time it is called, returns a new line from the file.
|
|
|
+ Opens the given file name in read mode and returns an iterator function that,
|
|
|
+ each time it is called, returns a new line from the file.
|
|
|
**/
|
|
|
public static function lines(?file : String) : NativeIterator<String>;
|
|
|
|
|
|
/**
|
|
|
This function opens a file, in the mode specified in the string mode.
|
|
|
It returns a new file handle, or, in case of errors, `null` plus an error message.
|
|
|
-
|
|
|
+
|
|
|
The mode string can be any of the following:
|
|
|
-
|
|
|
+
|
|
|
* `"r"`: read mode (the default)
|
|
|
* `"w"`: write mode
|
|
|
* `"a"`: append mode
|
|
|
* `"r+"`: update mode, all previous data is preserved
|
|
|
* `"w+"`: update mode, all previous data is erased
|
|
|
- * `"a+"`: append update mode, previous data is preserved, writing is only
|
|
|
+ * `"a+"`: append update mode, previous data is preserved, writing is only
|
|
|
allowed at the end of file
|
|
|
-
|
|
|
- The mode string can also have a `b` at the end, which is needed in some systems
|
|
|
- to open the file in binary mode. This string is exactly what is used in the
|
|
|
+
|
|
|
+ The mode string can also have a `b` at the end, which is needed in some systems
|
|
|
+ to open the file in binary mode. This string is exactly what is used in the
|
|
|
standard C function fopen.
|
|
|
**/
|
|
|
public static function open (filename : String, ?mode : String) : FileHandle;
|
|
|
|
|
|
/**
|
|
|
- Starts program `command` in a separated process and returns a file handle that
|
|
|
- you can use to read data from this program (if mode is `"r"`, the default)
|
|
|
+ Starts program `command` in a separated process and returns a file handle that
|
|
|
+ you can use to read data from this program (if mode is `"r"`, the default)
|
|
|
or to write data to this program (if mode is `"w"`).
|
|
|
-
|
|
|
+
|
|
|
This function is system dependent and is not available on all platforms.
|
|
|
**/
|
|
|
public static function popen(command : String, ?mode : String) : FileHandle;
|
|
@@ -92,8 +92,8 @@ extern class Io {
|
|
|
public static function read(?filename : String) : String;
|
|
|
|
|
|
/**
|
|
|
- Writes the value of each of its arguments to the file. The arguments must
|
|
|
- be strings or numbers.
|
|
|
+ Writes the value of each of its arguments to the file. The arguments must
|
|
|
+ be strings or numbers.
|
|
|
To write other values, use `Lua.tostring` or `NativeStringTools.format`
|
|
|
before write.
|
|
|
**/
|
|
@@ -108,7 +108,7 @@ extern class Io {
|
|
|
public static function tmpfile() : FileHandle;
|
|
|
|
|
|
/**
|
|
|
- Checks whether `obj` is a valid file handle.
|
|
|
+ Checks whether `obj` is a valid file handle.
|
|
|
**/
|
|
|
public static function type(obj : FileHandle) : IoType;
|
|
|
}
|
|
@@ -116,7 +116,7 @@ extern class Io {
|
|
|
/**
|
|
|
A enumerator that describes the output of `Io.type()`.
|
|
|
**/
|
|
|
-@:enum
|
|
|
+enum
|
|
|
abstract IoType(String) {
|
|
|
var File = "file";
|
|
|
var ClosedFile = "closed file";
|