Attempt to support directories on case-sensitive filesystems
Validate before writing