Matlab behaving erratic when accessing files over VPN
Ältere Kommentare anzeigen
I'm not sure if this is a Windows issue or a Matlab issue, but I'm observing erratic behavior when I try to access files, using Matlab, from a network location over VPN. I'm using Matlab 2014b in Windows 7.
For instance, I have the code
filename_on_network_location = '\\mycompany.com\data\input.txt'
file_exist = exist(filename_on_network_location, 'file');
if ~file_exist
file_exist_new = exist(filename_on_network_location, 'file');
fprintf('Original : %d\n', file_exist);
fprintf('New : %d\n', file_exist_new);
if ~file_exist
error('file really does not exist');
end
end
which can print
Original : 0
New : 1
I have similar issues using the built-in dir command. I'm still checking to see if this double test gives a good workaround, but obviously I don't like it.
1 Kommentar
Walter Roberson
am 10 Jan. 2016
Shouldn't the second "if ~file_exist" be a test of ~file_exist_new ?
Antworten (0)
Kategorien
Mehr zu Data Type Identification finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!