Error using copyfile to make a backup of a folder on my desktop
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have been running a script that copies a file called "All Files" from my desktop to a different storage device directory. It has worked 40-50 times in the past. It utilizes the copyfile function in MATLAB. The relavent line of code reads:
[ SUCCESS,MESSAGE,MESSAGEID ] = copyfile(AllFilesDirectory,...
AllFilesBackupDirectory,...
'f')
Recently, instead of a successful copying of the file contents, I get
SUCCESS =
logical
0
MESSAGE =
'Unknown error occurred.'
MESSAGEID =
'MATLAB:COPYFILE:OSError'
The only thing that has changed is that I am continually adding new content to this folder. However, I have been doing so since I made the folder and began backing it up, so this is nothing new.
Edit: In case it is relevant, the folder is about 50 GB right now.
1 commentaire
Michal Dobai
le 7 Déc 2017
OK, I'm not sure if this can help you, but I'm getting exception with same ID when I'm trying to copy and replace the file used by another process (in my case opened excel file).
I know it's different type of error, but I was thinking if you call copyfile without output arguments it apparently throws an exception instead of error code and message. You will then can see stack trace, which could help you understand your problem.
Or another idea: If you can reproduce the problem, maybe you can try to copy file manually at the same time you getting error. Maybe same error will occur and your OS will give you more information. :)
Réponses (0)
Voir également
Catégories
En savoir plus sur Environment and Settings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!