Associates a file with a stream.
| Parameter | Description |
|---|---|
| String pathname | The full path name of a file. Must be valid for the current platform. |
| String charset | The character set used by the file. The character set that describes the file content. Defaults to System. |
| Return value | Description |
|---|---|
| boolean |
|
When a stream is opened, property values are:
It is recommended that you call close when you are finished processing the stream.
Valid character sets include: ASCII, Big5, Binary, EUC-JP, EUC-KR, EUC-TW, GF2312, ISO-2022-JP, ISO-2022-KR, ISO-8859-1 through ISO-8859-9, ISO-8859-15, KOI8-R, Latin4, Shift-JIS, System, TCVN3, Unicode, Unicode-1-1, US-ASCII, UTF-7, UTF-8, UTF-16, UTF-16BE, UTF-16LE, Windows-1250 through Windows-1258, and Windows-874. The Binary character set implies byte operations only on the stream. Unicode is the same as UTF-16 and Unicode-1-1 is a compatible subset of UTF-16.
This method fails if:
var stream:NotesStream = session.createStream();
var filename:string = "c:\\dxl\\";
filename = filename + database.getFileName();
filename = filename.substring(0, filename.length() - 3) + "dxl";
if (stream.open(filename)) {
requestScope.status = "Opened " + filename;
stream.truncate();
// Create note collection
var nc:NotesNoteCollection = database.createNoteCollection(false);
nc.setSelectDocuments(true);
nc.buildCollection();
// Export note collection as DXL
var exporter:NotesDxlExporter = session.createDxlExporter();
var output:string = exporter.exportDxl(nc);
stream.writeText(output);
requestScope.status = "Exported note collection as DXL ";
stream.close();
} else {
requestScope.status = "Unable to open " + filename;
}