Xgit v0.7.1 Xgit.FileMode View Source

Describes the file type as represented on disk.

Link to this section Summary

Types

t()

An integer describing the file type as represented on disk.

Functions

Mode indicating an entry is an executable file.

Return true if the file mode represents an executable file.

Mode indicating an entry is a submodule commit in another repository.

Return true if the file mode represents a submodule commit in another repository.

This guard requires the value to be one of the known git file mode values.

Mode indicating an entry is a non-executable file.

Return true if the file mode represents a regular file.

Mode indicating an entry is a symbolic link.

Return true if the file mode a symbolic link.

Return a rendered version of this file mode as an octal charlist.

Mode indicating an entry is a tree (aka directory).

Return true if the file mode represents a tree.

Return true if the value is one of the known file mode values.

Link to this section Types

Link to this type

t()

View Source
t() :: 33188 | 33261 | 40960 | 16384 | 57344

An integer describing the file type as represented on disk.

Git uses a variation on the Unix file permissions flags to denote a file's intended type on disk. The following values are recognized:

  • 0o100644 - normal file
  • 0o100755 - executable file
  • 0o120000 - symbolic link
  • 0o040000 - tree (subdirectory)
  • 0o160000 - submodule (aka gitlink)

This module is intended to be used. Doing so will create an alias to the module so as to make FileMode.t available for typespecs and will import the is_file_mode/1 guard.

Link to this section Functions

Link to this function

executable_file()

View Source
executable_file() :: t()

Mode indicating an entry is an executable file.

Link to this function

executable_file?(file_mode)

View Source
executable_file?(file_mode :: term()) :: boolean()

Return true if the file mode represents an executable file.

Link to this function

gitlink()

View Source
gitlink() :: t()

Mode indicating an entry is a submodule commit in another repository.

Link to this function

gitlink?(file_mode)

View Source
gitlink?(file_mode :: term()) :: boolean()

Return true if the file mode represents a submodule commit in another repository.

Link to this macro

is_file_mode(t)

View Source (macro)

This guard requires the value to be one of the known git file mode values.

Link to this function

regular_file()

View Source
regular_file() :: t()

Mode indicating an entry is a non-executable file.

Link to this function

regular_file?(file_mode)

View Source
regular_file?(file_mode :: term()) :: boolean()

Return true if the file mode represents a regular file.

Link to this function

symlink()

View Source
symlink() :: t()

Mode indicating an entry is a symbolic link.

Link to this function

symlink?(file_mode)

View Source
symlink?(file_mode :: term()) :: boolean()

Return true if the file mode a symbolic link.

Link to this function

to_short_octal(file_mode)

View Source
to_short_octal(file_mode :: t()) :: charlist()

Return a rendered version of this file mode as an octal charlist.

No leading zeros are included.

Optimized for the known file modes. Errors out for any other mode.

Mode indicating an entry is a tree (aka directory).

Link to this function

tree?(file_mode)

View Source
tree?(file_mode :: term()) :: boolean()

Return true if the file mode represents a tree.

Return true if the value is one of the known file mode values.