Prev | Current Page 588 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


stderr() : FileOutput Returns an output stream object for appending data to the
stderr object.
stdin() : FileInput Returns an input stream object for reading data from the
stdin object.
stdout() : FileOutput Returns an output stream object for appending data to the
stdout object.
write( path : String, binary
: Bool ) : FileOutput
Returns an output stream object for writing data to a file.
Reading and Writing Data to a File
Thanks to the stream objects provided by the neko.io package, it ??™ s possible to access the content of a file
no matter where that file is located. All that is required is a FileInput or FileOutput handle on the file
in question. Once a file stream handle is assigned to a file object, you can theoretically output the data
305
Chapter 11: Performing Server-Side Trickery
from that file to pretty much anywhere, including a remote server, if you so want. Likewise, any data
you can push into a stream object can be directed into the content of a file.
To attain a stream handle on a file, you first have to decide which direction your data will be traveling.


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