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:
void init ( nsIFile file , PRInt32 ioFlags , PRInt32 perm , PRInt32 behaviorFlags )
- file: file to read from (must QI to nsILocalFile)
- ioFlags: file open flags listed in prio.h
- perm: file mode bits listed in prio.h
- behaviorFlags: flags specifying various behaviors of the class (see enumerations in the class)
Reference documentation is generated from Mozilla's source.
* The file status flags.
* It is a bitwise OR of the following bit flags (only one of
* the first three flags below may be used):
* PR_RDONLY Open for reading only.
* PR_WRONLY Open for writing only.
* PR_RDWR Open for reading and writing.
* PR_CREATE_FILE If the file does not exist, the file is created
* If the file exists, this flag has no effect.
* PR_SYNC If set, each write will wait for both the file data
* and file status to be physically updated.
* PR_APPEND The file pointer is set to the end of
* the file prior to each write.
* PR_TRUNCATE If the file exists, its length is truncated to 0.
* PR_EXCL With PR_CREATE_FILE, if the file does not exist,
* the file is created. If the file already
* exists, no action and NULL is returned
#define PR_RDONLY 0x01
#define PR_WRONLY 0x02
#define PR_RDWR 0x04
#define PR_CREATE_FILE 0x08
#define PR_APPEND 0x10
#define PR_TRUNCATE 0x20
#define PR_SYNC 0x40
#define PR_EXCL 0x80
** CAVEAT: 'mode' is currently only applicable on UNIX platforms.
** The 'mode' argument may be ignored by PR_Open on other platforms.
** 00400 Read by owner.
** 00200 Write by owner.
** 00100 Execute (search if a directory) by owner.
** 00040 Read by group.
** 00020 Write by group.
** 00010 Execute by group.
** 00004 Read by others.
** 00002 Write by others
** 00001 Execute by others.