Copyfile fails in R2022a but not in R2021b
6 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Shuba Nandini
on 8 Sep 2023
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
0 Comments
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!