Retaining Zero-Length Files

The ZFS file retention feature treats zero-length files differently than other regular files.

When you retain a zero-length file, the file sets the appendonly attribute. If you retain a file that has the appendonly attribute set, the file remains append-only.

You can add or remove write permissions from a retained zero-length file or from a retained file that has the appendonly attribute set.

If you remove all write permissions, the file becomes a typical retained file, which sets the readonly attribute and unsets the appendonly attribute. You can achieve the same result by setting the readonly attribute or by unsetting the appendonly attribute.