Skip to content

Clarify directory permission format: 040000 vs 40000 #61

@andrew

Description

@andrew

The spec in Chapter 5.3 states that directories should use '040000' for normalized access rights, but the actual serialization uses "40000" (5 ASCII bytes) without the leading zero.

From the spec (line 61):

the normalized access rights, encoded as a sequence of ASCII-encoded octal digits ('100644' for regular [i.e., non-special] files, '100755' for executable files, '120000' for symbolic links, and '040000' for directories)

However, Git's tree object format stores this as the ASCII string "40000" (5 bytes: 34 30 30 30 30), not "040000" (6 bytes).

This caused confusion while implementing the Ruby library (https://github.com/andrew/swhid) as the notation suggests 6 characters when only 5 should be serialized.

Suggest clarifying that while the octal value is 040000, the serialization uses minimal ASCII representation without unnecessary leading zeros (same as Git).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions