The writable check for the readonly attribute now only applies to files, not directories.
Added writable test for system directory.