Xgit v0.1.0 Xgit.Core.FileMode

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 omde 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.

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()
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()
executable_file() :: t()

Mode indicating an entry is an executable file.

Link to this function

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

Return true if the file omde represents an executable file.

Link to this function

gitlink()
gitlink() :: t()

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

Link to this function

gitlink?(file_mode)
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) (macro)

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

Link to this function

regular_file()
regular_file() :: t()

Mode indicating an entry is a non-executable file.

Link to this function

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

Return true if the file mode represents a regular file.

Link to this function

symlink()
symlink() :: t()

Mode indicating an entry is a symbolic link.

Link to this function

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

Return true if the file mode a symbolic link.

Link to this function

tree()
tree() :: t()

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

Link to this function

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

Return true if the file mode represents a tree.

Link to this function

valid?(arg1)
valid?(term()) :: boolean()

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