java - TDI/Java-JavaScript System.openFileForOutput

标签 java javascript tivoli

我正在 TDI 中开发自定义脚本。该脚本根据返回的数组发送电子邮件。

发送电子邮件时,我使用函数 system.openFileForOutput 打开一个文件

然后我写下当前的电子邮件号码(1、2、3 等)。

然后我关闭system.openFileForOutput

因此,如果我在脚本到达关闭语句之前将其停止,文件将变为空,并且我不知道电子邮件在哪里停止。

我需要一些建议。如何保存脚本所在的电子邮件#而不丢失位置?

最佳答案

写入内容后可以立即关闭文件。然后在您想要再次关闭时打开它。

--打开新文件并写入

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

--将内容附加到之前创建的文件

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

还有一些 Google 小组针对 TDI 相关疑问。 https://groups.google.com/forum/#!forum/ibm.software.network.directory-integrator

关于java - TDI/Java-JavaScript System.openFileForOutput,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17413795/

相关文章:

javascript - 仅在月 View 中显示工具提示并在日 View 中隐藏

java - IBM Security (Tivoli) Directory Integrator 中的 HTTP 服务器连接器

java - 更改密码 LDAP Java

java - 如何用java读取pdf文件

javascript - 如何使用ajax从另一个页面获取div内容

javascript - Visual Studio 2015 中的 Underscore.js 语法突出显示

从 openLDAP 客户端到 IBM LDAP 的 ssl 连接

java - Java 中不同字节大小的字段相加?

java - 数组访问如何影响性能?

java - 从 RecyclerView 中的 ViewHolder 调用 Activity ?