The Linux "copy problem"
The Linux "copy problem"
Posted May 30, 2019 18:56 UTC (Thu) by jmgao (guest, #104246)Parent article: The Linux "copy problem"
> He does think that there should be a way to create files with all of their attributes atomically, however.
        
Isn't there already a solution to this? You can open a file on the filesystem you want to create the file on with O_TMPFILE to hide it until you've done all of your attribute twiddling, do your fsetfilecon, fsetxattr, etc. on the file descriptor, and then use linkat to put it into place.
 
           