WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIFileInputStream

IID:e3d56a20-c7ec-11d3-8cda-0060b0fc14a3
Inherits From:nsIInputStream

An input stream that allows you to read from a file.

This interface is intended to be used as an instance. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/network/file-input-stream;1"].
            createInstance(Components.interfaces.nsIFileInputStream);

This interface is implemented by the following components:


Constants

If this is set, the file will be deleted by the time the stream is closed. It may be removed before the stream is closed if it is possible to delete it and still read from it.

If OPEN_ON_READ is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again.

PRInt32 DELETE_ON_CLOSE = 2
If this is set, the file will close automatically when the end of the file is reached.
PRInt32 CLOSE_ON_EOF = 4
If this is set, the file will be reopened whenever Seek(0) occurs. If the file is already open and the seek occurs, it will happen naturally. (The file will only be reopened if it is closed for some reason.)
PRInt32 REOPEN_ON_REWIND = 8

Methods

void init ( nsIFile file , PRInt32 ioFlags , PRInt32 perm , PRInt32 behaviorFlags )

void init ( nsIFile file , PRInt32 ioFlags , PRInt32 perm , PRInt32 behaviorFlags )

Arguments:
file: file to read from (must QI to nsILocalFile)
ioFlags: file open flags listed in prio.h (see PR_Open documentation) or -1 to open the file in default mode (PR_RDONLY).
perm: file mode bits listed in prio.h or -1 to use the default value (0)
behaviorFlags: flags specifying various behaviors of the class (see enumerations in the class)

Reference documentation is generated from Mozilla's source.