Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Changelog

- Add documentation for 'mode' field in FileInfo.

## Unreleased

## v2.3.0 - 24 June 2025
Expand Down
9 changes: 9 additions & 0 deletions src/simplifile.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ pub type FileInfo {
/// File size in bytes.
size: Int,
/// File mode that indicates the file type and its permissions.
///
/// This field enocodes file type and permissions in a 16 bit int in
/// the following order
/// - bits 15-12: File Type. e.g RegularFile, Symlink, Directory
/// - bits 11-9 : Special file permissions such as setUserId, setGroupId, and the Sticky-bit
/// - bits 8-6 : User read, write, and execute permisions.
/// - bits 5-3 : Group read, write, and execute permissions.
/// - bits 2-0 : Other read, write, and execute permissions.
///
/// For example, in Unix and Linux, a mode value of 33188 indicates
/// a regular file and the permissions associated with it
/// (read and write for the owner, and read-only for others, in
Expand Down