Prev | Current Page 587 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


Working with Files and Streams
Working with file creation, along with writing data to and from files, requires the use of the neko.io
package. There are a good number of classes here, including several base classes you can extend to
provide your own stream handling functionality. All data written to files comes from the base neko.
io.FileOutput class, while reading from a file may or may not require the use of the neko.io.
FileInput class. Table 11 - 9 lists the methods provided by the neko.io.File class.
Table 11-9
Method Description
append( path : String,
binary : Bool ) : FileOutput
Returns an output stream object for appending data to the
end of a file.
copy( src : String, dst :
String ) : Void
Copies a file from one location to another. Copying a
directory throws an exception.
getChar( echo : Bool ) : Int Reads a char value from the associated file.
getContent( path : String )
: String
Returns the string content from a given path.
read( path : String, binary
: Bool ) : FileInput
Returns an input stream object for reading data from a file.


Pages:
575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599