Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

How to copy a file and preserve the "owner"?

$
0
0

I wrote a program to copy files and folders to use for backup purposes which is mostly working, but the owner gets set to the user doing the copy? Is there a way to set the copied file's owner to be the same as the original file's owner? (This program is already setting backup and restore privileges).

Nevermind for now, I'm already using GetSecurityInfo and SetSecurityInfo to get DACL info. It seems I just need to add the owner and group id stuff.

However for a catastrophic (OS partition failure) restore using a different instance of Windows (multi-boot system), I'm wondering if the restore process will end up creating files or directories that it can't write to (owner  / sid / dacl conflicts).



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>