是德科技
直播中

熊辉

8年用户 209经验值
私信 关注
[问答]

文件关闭问题

大家好,我有一个应用程序,如果主日志文件不可用(即网络故障),它将在辅助日志文件中生成一个条目。一旦打开日志文件,我将其保持打开状态直到应用程序结束但是,如果
主文件没有问题,可能无法打开辅助文件。
当用户按下“完成”按钮时,我使用“To_File / Execute Close”对象来确保两个文件都已正确关闭。
没问题,一切都运行良好,即使有鼻子文件。最近我决定允许操作员更改辅助文件的目录,所以我为To_Fileobject提供了文件名控制输入引脚。
不幸的是,在这种情况下,Vee的行为有点不同 - 如果文件不存在,Vee创建它然后,Iassume,关闭它。
出于多种原因,我不希望生成空数据文件。
实际上,我不希望生成任何sortbeing的空文件。
这是一个合法且理想的Vee“功能”吗?我知道在DOS时代关闭文件是一件大事。
在Windows 2000机器上留下Vee应用程序时,我真的需要“执行关闭”吗?Barriewhoi

以上来自于谷歌翻译


     以下为原文

  Hi folks,

I have an application that will make an entry in a secondary log file
only if the primary log file is not available (i.e. network failure).
Once a log file has been opened, I leave it open until the application
ends but, if the primary file has no problems, the secondary file may
never be opened.  When the user presses the "Done" button, I use a
"To_File/Execute Close" object to make sure both files have been closed
correctly.  No problem, everything works well even if there is no
secondary file.

Recently I decided to allow the operator to change the secondary file's
directory so I provided a file name control input pin to the To_File
object.  Unfortunately, Vee acts a little differently under this
condition - if the file doesn't exist, Vee creates it and then, I
assume, closes it.  For a number of reasons, I don't want empty data
files being generated.  In fact, I don't want empty files of any sort
being generated.  Is this a legitimate and desirable Vee "feature"?

I know closing a file was a big deal back in the DOS days.  Do I really
need to "execute close" when leaving a Vee application on a Windows 2000
machine?

Barrie
whoi

---
You are currently subscribed to vrf as: r***@soco.agilent.com
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com".  
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

回帖(1)

李秀云

2019-10-31 13:35:59
Barrie - >在Windows 2000>机器上离开Vee>应用程序时,我真的需要“执行>关闭”吗?我会 - 即使文件是经常写入的。
唯一的原因是因为这是冲洗我所知道的缓存/缓冲区的唯一方法(无论如何都不会过度参与)。
如果发生了可怕的事情,那么数据丢失的可能性会降低。无论如何,您应该能够通过在To To文件之前使用From File来检查文件是否存在(在打开文件之前)。
在文件中粘贴anerror pin。
如果文件不存在......你知道。我知道它不是kosh来解决错误,但有时它只是有意义。-SHAWN ----你目前订阅vrf为:r***@soco.agilent.comTo
取消订阅会发送一封空白电子邮件至“leave-vrf@it.lists.it.agilent.com”。要向此邮件列表发送邮件,请发送电子邮件至“vrf@it.lists.it.agilent.com”。
如果您需要有关邮件列表的帮助,请发送邮件至“owner-vrf@it.lists.it.agilent.com”。

以上来自于谷歌翻译


     以下为原文

  Barrie -

> Do I really need to "execute
> close" when leaving a Vee
> application on a Windows 2000
> machine?

I would - even if the file is written to frequently. The only reason is
because that's the only way of flushing the cache/buffers I know of (without
getting over involved anyway). If something terrible happens there's less
chance of data loss.

Anyway, you should be able to check for the existence of a file (before
opening it for writing) by using a From File before a To File. Stick an
error pin on the from file. If the file doesn't exist... you know.

I know it's not kosh to fire errors, but sometimes it just makes sense.
-SHAWN-


---
You are currently subscribed to vrf as: [email=r***@soco.agilent.com]r***@soco.agilent.com[/email]
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@it.lists.it.agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
举报

更多回帖

发帖
×
20
完善资料,
赚取积分