How to keep file attributes by using Copyfile in Matlab
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Pedram Arabschahi
el 13 de Jul. de 2017
Comentada: Guillaume
el 19 de Jul. de 2017
Hello everyone,
I have a small question on how you preserve file attributes, when you use copyfile(source, destination)? By doing so, I take over the ownership, which I do not want. I just want to copy them to another folder ''Archive''.
Thank you in advance Pedram
0 comentarios
Respuesta aceptada
Guillaume
el 13 de Jul. de 2017
What you're seeing is the normal behaviour of file copy on all OSes.
Matlab itself does not give you any way to override that. You'll have to defer to your OS. If you're on Windows, you can use robocopy (included in windows 7, 8, and 10, not just server).
!robocopy source destination /copyall
will preserve everything.
0 comentarios
Más respuestas (1)
Pedram Arabschahi
el 18 de Jul. de 2017
3 comentarios
Guillaume
el 19 de Jul. de 2017
Well, yes, without administrative rights, robocopy, or any other program for that matter, will not let you impersonate another user which is required when creating a file with a different ownership than yours.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!