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

8 Ansichten (letzte 30 Tage)
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 Kommentare
Márcia Nunes
Márcia Nunes am 25 Apr. 2022
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 am 25 Apr. 2022
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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by