You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If subuid_tfile and subuid_file/subgid_file are on the same filesystem, you could use os.rename() instead of shutil.copyfile().
os.rename() will perform the rename(2) syscall under the hood, hence the operation will be atomic and subuid_file/subgid_file will always be in a valid state.
Alternatively you could use shutil.move(), but I think that os.rename() is safer because os.rename() fails if src and dst are not on the same device. IMO the failure is good because it means that either we get atomicity or a failure.
If subuid_tfile and subuid_file/subgid_file are on the same filesystem, you could use os.rename() instead of shutil.copyfile().
os.rename() will perform the rename(2) syscall under the hood, hence the operation will be atomic and subuid_file/subgid_file will always be in a valid state.
Alternatively you could use shutil.move(), but I think that os.rename() is safer because os.rename() fails if src and dst are not on the same device. IMO the failure is good because it means that either we get atomicity or a failure.
I would use os.rename() here
fakerootuidsync/fakerootuidsync
Line 126 in 425ee20
and here
fakerootuidsync/fakerootuidsync
Line 127 in 425ee20
what do you think?
The text was updated successfully, but these errors were encountered: