Summary
Fat12Entry exposes three raw DOS-packed integer fields — createdDate,
modifiedDate, and modifiedTime — straight from the on-disk directory entry.
Callers currently have to know the FAT bit-packing to make sense of them. Add
pure helper functions that decode these packed values into java.time
types.
Why this is a good first issue
- Pure functions, no I/O — no device, no rollback path, no golden images.
- The encoding is fully specified by the FAT spec, so behaviour is unambiguous.
- Excellent, well-bounded test surface (exact bit patterns → exact dates/times).
Background — the FAT date/time packing
Date (16-bit, applies to createdDate / modifiedDate):
- bits 0–4: day of month (1–31)
- bits 5–8: month (1–12)
- bits 9–15: year offset from 1980
Time (16-bit, applies to modifiedTime):
- bits 0–4: seconds / 2 (0–29 → 0–58s)
- bits 5–10: minutes (0–59)
- bits 11–15: hours (0–23)
Proposed change
Add pure decode helpers (free functions or an extension/companion on Fat12Entry),
e.g.:
/** Decode a FAT-packed 16-bit date field into a LocalDate (null if the field is 0). */
fun decodeFatDate(packed: Int): LocalDate?
/** Decode a FAT-packed 16-bit time field into a LocalTime (2-second resolution). */
fun decodeFatTime(packed: Int): LocalTime
Convenience accessors on the entry are welcome too (e.g.
Fat12Entry.modifiedDateTime(): LocalDateTime?), as long as the underlying
raw Int fields stay as-is for backward compatibility.
Acceptance criteria
Pointers
core/src/main/kotlin/com/ams/fat12ex/core/Fat12Entry.kt — the three raw fields.
- Listing entries to test against:
Fat12Volume.list("/") returns List<Fat12Entry>.
- Mirror an existing pure-logic test style from
core/src/test/kotlin/com/ams/fat12ex/core/.
How to get started
git clone https://github.com/AlbatrossMicrosystems/fat12-engine.git
cd fat12-engine
./gradlew :core:test
Summary
Fat12Entryexposes three raw DOS-packed integer fields —createdDate,modifiedDate, andmodifiedTime— straight from the on-disk directory entry.Callers currently have to know the FAT bit-packing to make sense of them. Add
pure helper functions that decode these packed values into
java.timetypes.
Why this is a good first issue
Background — the FAT date/time packing
Date (16-bit, applies to
createdDate/modifiedDate):Time (16-bit, applies to
modifiedTime):Proposed change
Add pure decode helpers (free functions or an extension/companion on
Fat12Entry),e.g.:
Convenience accessors on the entry are welcome too (e.g.
Fat12Entry.modifiedDateTime(): LocalDateTime?), as long as the underlyingraw
Intfields stay as-is for backward compatibility.Acceptance criteria
decodeFatDate/decodeFatTime(or equivalent) added and public.Intfields onFat12Entryare unchanged (additive only).2026-06-18and a known time, plus edge cases:0date, day/month = 1, year 1980 (offset 0), seconds rounding (odd seconds truncate to even)../gradlew :core:testpasses.Pointers
core/src/main/kotlin/com/ams/fat12ex/core/Fat12Entry.kt— the three raw fields.Fat12Volume.list("/")returnsList<Fat12Entry>.core/src/test/kotlin/com/ams/fat12ex/core/.How to get started
git clone https://github.com/AlbatrossMicrosystems/fat12-engine.git cd fat12-engine ./gradlew :core:test