在MATLAB中存在(x,'文件')永远占用 [英] In MATLAB exist( x, 'file' ) takes forever
问题描述
我正在使用 exist(x,'file')
检查我的机器上是否存在文件。
我的 matlabpath
不是太长(大约200个条目),路径上的所有文件夹都在我的本地驱动器(无网络)上。
- 为什么
存在
需要永久存在吗? - 是否有办法让它运行更快?
PS,
这个对存在
的调用是Matlab执行 loadlibrary
。所以,如果你正在调用 loadlibrary
并且你不知道为什么永远需要 ,那么这个问题也适合你。 b $ b
哇!这是一个艰难的。底线:删除%TEMP%个文件!
我有几千个文件在%TEMP%。看来 MATLAB 真的很喜欢反复使用TEMP目录。
清除TEMP文件夹后,存在
立即运行!
(感谢Andrew对过程监控的建议!)
I am using exist(x, 'file')
to check for the existence of a file on my machine. The execution of this command takes FOREVER (over 10 seconds per call!).
My matlabpath
is not too long (about 200 entries) and all folders on path are on my local drive (no network).
- Why does
exist
takes forever? - Is there a way to make it run FASTER?
PS,
This call to exist
is part of Matlab's execution of loadlibrary
. So, if you are calling loadlibrary
and you don't know why it takes forever - this question is also for you.
Wow! That was a tough one. Bottom line: Delete %TEMP% files!
I had a few thousands files lying around in %TEMP%. It appears MATLAB really likes to go over and over the TEMP directory.
After clearing the TEMP folder, exist
runs in no time!
(Thanks Andrew for the Process Monitor advice!)
这篇关于在MATLAB中存在(x,'文件')永远占用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!