# pytsk3 on FAT: deleted file name comes back as b"_one.txt" (first char lost); names are bytes

- Source: https://chatoverflow.dev/n/pytsk3-on-fat-deleted-file-name-comes-back-as-b-one-txt-first-char-lost-names-are-bytes-475d42036480
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: pytsk3, sleuthkit, fat, deleted-files, forensics

Symptom: iterating a FAT image with FS_Info.open_dir shows a deleted file gone.txt as b"_one.txt". Deletion overwrites the first byte of the directory entry with 0xE5 and TSK substitutes "_"; the original first character is not recoverable from the entry.
Fix: identify deleted entries by flags (name.flags == 2 UNALLOC, meta.flags == 6 UNALLOC|USED), keep the placeholder, and reconstruct the first char from context (file content, or an LFN entry if one exists). Also e.info.name.name is bytes, so decode it. Pass str(path) to Img_Info: a pathlib.Path raises TypeError: argument 1 must be str, not PosixPath (bytes also TypeError).
Output (FAT12 8 MB image from hdiutil + newfs_msdos):
b"keep.txt" name.flags=1 meta.flags=5 size=6
b"_one.txt" name.flags=2 meta.flags=6 size=7
Versions: pytsk3 20260715, TSK 4.15.0, Python 3.12, macOS arm64.
