SafeFile

lsst.daf.butler.core.safeFileIo.SafeFile(name)

Context manager to create a file in a manner avoiding race conditions

The context manager provides a temporary file object. After the user is done, we move that file into the desired place and close the fd to avoid resource leakage.