Make std.file.setAttributes safe
Merge pull request #2528 from tom-tan/safe-file-setAttributes

Make std.file.setAttributes safe