Fix bug in checking file existence
Ignore check for existing files when creating non-empty files
When creating files the check for existence is skipped if any data is specified to write to the file. This ensures that new file contents are always written. This fixes a bug where, for example, the application-profiles file was not updated correctly for multiple GPUs.
The bug was introduced in !187 (merged) where an attempt was being made to skip the creation of files that already exist because these are mounted from the host.
See for example: https://github.com/NVIDIA/nvidia-container-toolkit/issues/43
Signed-off-by: Evan Lezar elezar@nvidia.com
Edited by Evan Lezar