Copyfile: WSL directories (\\wsl$Ubuntu\....) as the arguments gives me this error: "The name of the file cannot be resolved by the system."

조회 수: 4 (최근 30일)
I downloaded a dataset using Windows Subsystem for Linux (WSL) and so the paths start like this: "\\wsl$ubuntu\home\<user_name>\dataset_name\".
I am currently using Matlab 2019a in Windows 10.
I want to use the function copyfile to copy a file from one folder inside the dataset to another, also inside the dataset folder. This is what I tried:
copyfile('\\wsl$\Ubuntu\home\<user_name>\<dataset_name>\inputs\raw\<filename>', '\\wsl$\Ubuntu\home\<user_name>\<dataset_name>\<output_folder>\')
This is the error I get:
Error using copyfile
The name of the file cannot be resolved by the system.
Do you know how to deal with WSL directories using Matlab (R2019a) in Windows?
  댓글 수: 6
Márcia Nunes
Márcia Nunes 2022년 4월 25일
I have been trying to use copyfile with other files and I noticed that it does not works for nifti files (.nii) but for others it does. The files I been trying to copy are Nifti files.
Jan
Jan 2022년 4월 25일
This sounds rather strange. The operating system does not know anything about the contents on a file. That the file name ends with ".nii" does not matter in any way. Therefore I'm sure, that there is another problem. Maybe the destination file is already opened by another software?

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by