From 951f7756f921e0fb31ecb2f3497d59124a956141 Mon Sep 17 00:00:00 2001 From: Daniel Jeremiah Date: Tue, 22 Jul 2025 01:54:44 -0400 Subject: [PATCH 1/2] added documentation for mode --- src/simplifile.gleam | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/simplifile.gleam b/src/simplifile.gleam index 4bdabab..f908e3b 100644 --- a/src/simplifile.gleam +++ b/src/simplifile.gleam @@ -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 From 0122ddc3b3095766035f5fbf57e5a1987298185d Mon Sep 17 00:00:00 2001 From: Daniel Jeremiah Date: Tue, 22 Jul 2025 01:57:30 -0400 Subject: [PATCH 2/2] updated CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 519f178..456be30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +- Add documentation for 'mode' field in FileInfo. + ## Unreleased ## v2.3.0 - 24 June 2025