Support setting and querying opsys and external attributes.

For newly added files, set operating system to UNIX, permissions
to 0666 (0777 for directories).
14 files changed