BZ-1073473: checking if file exists before file creation