필터 지우기
필터 지우기

exist(x,'dir') slow for unavailable network drives

조회 수: 10 (최근 30일)
Arsalan jamialahmadi
Arsalan jamialahmadi 2014년 10월 12일
댓글: Arsalan jamialahmadi 2018년 11월 17일
I use exist(x,'dir') to check existence of a directory x. My problem is that checking existence of an address on a network drive when computer is not connected to the network takes something about 50 seconds. Checking existence of the address when computer is connected to the network however takes something about 0.0005 seconds.
I tried using
[a,b]=dos('net use x')
and I get list of connected network drives but it does not return the connected network drives as separate variable.
How can I speed up this process? I really appreciate any help!
  댓글 수: 4
Arsalan jamialahmadi
Arsalan jamialahmadi 2014년 10월 16일
Thanks Sddharth, I actually very fast get a response on my browser that I am not connected to internet. But in offline mode when I try to open one of network drives, it takes long time, it can be related to some time-out that I don't know about. This might be related to the low velocity of EXIST.
Arsalan jamialahmadi
Arsalan jamialahmadi 2014년 10월 16일
Thanks Mohammad,
Result of running is attached to a text file attached to this comment.

댓글을 달려면 로그인하십시오.

답변 (1개)

per isakson
per isakson 2018년 11월 17일
편집: per isakson 2018년 11월 17일
I use exist(x,'dir') to check existence of a directory x. What's the value of x ?
Did you mean to run
num = exist( 'x:\', 'dir' );
which is fast enough whether 'x:\' exists or not.
  댓글 수: 3
per isakson
per isakson 2018년 11월 17일
편집: per isakson 2018년 11월 17일
Good question. My guess is yes.
OP writes I get list of connected network drives and I guessed that x is her/his local drive letter.
Arsalan jamialahmadi
Arsalan jamialahmadi 2018년 11월 17일
x normally is address of a directory on the network. So when Iam connected to the network, this checking is fast but as soon as my connection is lost, response from "Exist" is slow.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Downloads에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by