批处理文件中的第二个进程无法访问第一个进程创建的文件 [英] Second process in batch file can not access file created by first process

查看:84
本文介绍了批处理文件中的第二个进程无法访问第一个进程创建的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 


我有两个程序'A'和'B'。


我正在批量执行这两个程序文件顺序。 'A'流程在网络位置创建一个文件并终止,'B'流程读取流程'A'创建的文件。 


但是流程'B尝试打开文件,我发现找不到文件错误。


如果我在进程A执行后在批处理文件中加1秒睡眠,那么B可以读取该文件。我也使用本地文件夹,然后B也可以读取文件。


那么为什么流程'A'创建的文件不能立即用于流程'B'?  Windows OS是否需要一些时间来更新其他进程的文件可见性?




拉曼

解决方案

>那么为什么进程'A'创建的文件不能立即用于进程'B'? Windows操作系统是否需要一些时间来更新其他进程的文件可见性?


是否在创建文件的计算机上安装了防病毒产品 - 即使是内置的Windows AV?通过社区论坛NNTP服务器1.1.55.0\">

<


Hi 

I have two program 'A' and 'B'.

I am executing these two program through batch file sequentially. 'A' process create one file at network location and terminate and 'B' process read the file created by process 'A'. 

But while process 'B try to open the file, I am getting file not found error.

If I add 1 sec sleep in batch file after process A execution, then B can read the file. Also I use local folder, then also B can read the file.

So why is the file created by process 'A' is not available for process 'B' immediately?  Is windows OS takes some time to update the file visibility for other process??


Raman

解决方案

>So why is the file created by process 'A' is not available for process 'B' immediately?  Is windows OS takes some time to update the file visibility for other process??

Is there an anti virus product installed on the machine where the file is created - even the built in Windows AV?


这篇关于批处理文件中的第二个进程无法访问第一个进程创建的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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