'The network path was not found' intermittent error only on VPN
20 次查看(过去 30 天)
显示 更早的评论
Hello, I have code that scrapes a database and saves data in seperate directories by station, year, and month.
Because I'm pulling data regularly, I have the following code to create a new directory if the directory doesn't yet exist.
if ~exist(stationfolderloc, 'dir');
mkdir(stationfolderloc);
end
stationfolderloc is formatted as '[servername]\[some sub directories]\[station_name]\[year]\[month]' with the station_name, year, and month updating based on the data being pulled.
This never fails when I have a wired ethernet connection to the office network (the directory is on a server on that network). However, when I am out of office and connecting via VPN I inconsistantly get the following error. (is red text)
Error using mkdir
The network path was not found.
Error in [Code_name] (line XXX)
mkdir(stationfolderloc);
However, I am able to navigate to the directory in windows explorer, and have no problem navigating to it in Matlab such that it can be the Current Folder. Using the exist function in Matlab gives an output of 7 (exists and is a directory). Using ~exist(stationfolderloc, 'dir') returns 0. So the 'IF' statement shouldn't even allow the code to get to the mkdir command.
I've setup monitoring for the VPN and confirmed the connection never drops when the error occurs. VPN is FortiClient, if that matters, I've been working with them to troubleshoot and they believe its a matlab issue.
2 个评论
chrisw23
2024-4-3
It seems to be a security issue. Probably you are authenticated different via VPN. It may be a different group membership that prevents the creation of new folders. This is no Matlab issue.
You can try to map your root folder (ServerShare\...) and access the mapped drive by Matlab.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!