Copyfile fails in R2022a but not in R2021b

4 次查看(过去 30 天)
I have a fairly large MATLAB driven test system that uses copyfile to place some test specific files into place for runs. On Ubuntu 2004 with MATLAB R2021b, this line
copyfile('/home/djc/gsfcgmat/jazz/test/script/gmatdata','/home/djc/gsfcgmat/TestTarget/GMAT-R2022a-Linux-x64','f')
copies the files into place. On the same system using MATLAB R2022a, the command fails and reports
Error using copyfile
Invalid argument
Why is it failing under MATLAB R2022a?

回答(1 个)

Shuba Nandini
Shuba Nandini 2023-9-8
Hello Darrel,
Thanks for reaching us over email. This is a known issue that only appears on some machines, and we currently do not have a workaround for it.
Please try the following steps to diagnose the machine that is having issues:
1) Try to use the system's copy command from MATLAB. You can use the following example:
!cp Firefox_wallpaper.png ../dir2/"
2) Try using fully qualified URLs, where 'path' is the appropriate full path:
copyfile('file:///path/to/Firefox_wallpaper.png', 'file:///path/dir2/Firefox_wallpaper.png');
3) Make sure that 'copyfile' is not shadowed by another function, using command:
which -all copyfile
4)Check if 'copyfile' command works on both command line and MATLAB command line.
5)Check permissions on Unix using 'la -ls' and change them with 'chmod' if necessary.
6)Try reinstalling the MATLAB.
I hope this helps!
Regards,
Shuba Nandini

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by