Frage

I'm developing a custom script in TDI. This script sends emails out based on a returned array.

As the emails are sent, I open up a file using the function system.openFileForOutput

Then I write the current email number, (1, 2, 3, etc).

Then I close the system.openFileForOutput.

So if I stop the script in the middle before it reaches the close statement, the file becomes empty and I don't know where the emails stopped.

I need some advice. How can I save the email # the script is at without losing the location?

War es hilfreich?

Lösung

You can close the file immediately after writing the content. Then open it whenever you want again close it.

--open new file and write

var file = "D:\\dump.txt";
var outfile = system.openFileForOutput(file);
outfile.newLine ();
outfile.write("Report")
outfile.newLine ();
outfile.close (); 

--append content to the previously created file

var file = "D:\\dump.txt";
var outfile = system.openFileForAppend(file);
outfile.newLine ();
outfile.write("Report")
outfile.newLine ();
outfile.close (); 

Also there are some google groups for TDI related doubt. https://groups.google.com/forum/#!forum/ibm.software.network.directory-integrator

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top