来自过程的多个OS-COMMAND调用冲突 [英] Multiple OS-COMMAND calls from procedure are conflicting

查看:82
本文介绍了来自过程的多个OS-COMMAND调用冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个过程,该过程包括编写文件,使用mail_files通过电子邮件发送文件,然后使用OS-DELETE语句在文件发送后将其删除.调用mail_files或实际OS-COMMAND本身的外部过程的调用是异步的.操作系统为AIX 6,Progress版本为102B.下面是一个示例:

I have a procedure which is writing a file, emailing it using mail_files, and then an OS-DELETE statement to delete the file after it is sent. The call to the external procedure which calls mail_files or the actual OS-COMMAND itself are asynchronous. The OS is AIX 6 and the version of Progress is 102B. Here's an example below:

这是主要过程:

DEFINE STREAM outStr.
OUTPUT STREAM outStr TO foo.txt.

FOR EACH customer NO-LOCK:
  EXPORT STREAM outStr customer.
END.
OUTPUT STREAM outStr CLOSE.   /*EDIT: The problem occurs even if it's closed*/
RUN sendmail.p.
OS-DELETE foo.txt.

这是sendmail.p:

Here is sendmail.p:

DEFINE STREAM stMail.
OUTPUT STREAM stMail THROUGH
   "mail_files -f foo@bar.com -t me@here.com -s\"subject\" -b~\foo.txt\").
PUT STREAM stMail "Email body".
OUTPUT STREAM stMail CLOSE.

在我自己进行测试时,我无法复制该错误. Progress是否正在尝试优化"某些内容?有什么可以不用硬编码暂停就可以完全按照我的意愿做的吗?

In testing it on my own, I can't replicate the error. Is Progress trying to "optimize" something here? Is there anything to cleanly make it do what I want without hard-coding a pause?

在尝试发送电子邮件之前,流已关闭,但是仍然会发生错误.没有发送部分文件.

The stream is being closed before the email attempt, but the error still occurs. No partial file is sent.

我收到的错误来自mail_files,因为它找不到文件.我已经检查过了,并且没有安排运行其他任何访问该文件的进程.

The error I get is from mail_files because it can't find the file. I've checked, and no other processes are scheduled to run which would access the file.

No such file or directory
/usr/local/bin/mail_files[268]: foo.txt: cannot open 

推荐答案

DEFINE STREAM outStr.
OUTPUT STREAM outStr TO foo.txt.

FOR EACH customer NO-LOCK:
  EXPORT STREAM outStr customer.
END.

/* Dont forget to close */
OUTPUT STREAM outStr CLOSE.

RUN sendmail.p.

OS-DELETE foo.txt.

这篇关于来自过程的多个OS-COMMAND调用冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆