Nonsense string needed to access network path: \\?\UNC\
23 次查看(过去 30 天)
显示 更早的评论
I am running an analysis in paralell on a handful of machines.
- The machines all have the same access to the server with the data.
- On the problem machine, the files can only be read or written when I append a (seemingly) nonsense string to the beginning of the path.
- This does not apply to the logfile.txt, but to pngs, csvs, and mat-files.
- I discovered what the magic string was when I used "Copy as path" in the file explorer and pasted directly into the load function.
- This is the only machine running R2022b and not R2023a
I suspect it has something to do with not being able to interpret the file as -ascii and not comm issues with the network, since the txt file is . Is this a known issue?
try
load(fullfile(filepath,filename),"-mat")
catch
filepath_original = filepath;
filepath = strrep(filepath,'\\m','\\?\UNC\m');
end
0 个评论
采纳的回答
Arka
2023-8-14
Hi Bransa,
From what I understand, you have to add the string "\\?\UNC\" to the beginning of the path of the file for it to be successfully read on MATLAB R2022b.
The prefix "\\?\UNC\" is a Windows file path prefix, used to access files and directories on a network shared drive using the Universal Naming Convention (UNC) format.
In UNC, a network resource is identified by its network name or IP address, followed by the path to the shared resource. The "\\?\UNC\" prefix is used to bypass the path length limitations in Windows, allowing us to specify paths longer than the 260-character limit enforced by Windows.
Hope this helps.
Thank you.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Manage Products 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!