Skip to main content

Module filesystem_identity

Module filesystem_identity 

Source
Expand description

The filesystem identity recorded with every real index.lock a transaction creates. What: The filesystem identity recorded with every real index.lock a transaction creates, spelled exactly as the incumbent’s @monochromatic-dev/module-fs-id spells it. Why: Recovery removes a real index.lock only when its device, inode and filesystem identity all match the journal; the incumbent compares the recorded fsId with the one it resolves now, so both wrappers must resolve the same text for the same filesystem (package/module/fs-id/src/platform-resolvers.ts, parsers.ts).

In TS you’d write (pseudocode):

const { value } = await resolveFsId({ path: lockPath, emitDiagnostics: false });

Enums§

FsIdSource
What: The mechanism that supplied an identity, which names its prefix. Why: SOURCE_PREFIXES in the incumbent: stable sources and degraded fallbacks are told apart in the text itself.

Functions§

create_fs_id
What: The identity text <prefix><payload> for a normalized payload. Why: createFsId.
filesystem_identity
What: The filesystem identity of the filesystem holding path, or nothing when no mechanism answers. Why: The incumbent canonicalizes the path first and then asks the platform’s mechanism; on macOS and Windows the commands are the incumbent’s own.
normalize_identity_payload
What: Normalize one command-supplied payload: trim, lowercase, then accept only non-empty safe ASCII up to 512 characters that is not a lone -. Why: normalizeIdentityPayload; anything else is no identity.
parse_df_device
What: The mounted device node in POSIX df -P output: the first field of the last non-empty row that starts with /dev/ and holds only safe characters. Why: parseDfDevice on macOS.
parse_diskutil_volume_uuid
What: The VolumeUUID string of a diskutil info -plist property list, normalized. Why: parseDiskutilVolumeUuid on macOS.
source_prefix
What: The prefix of one source. Why: The identity text is <prefix><payload>.
windows_drive_root
What: The uppercase drive root X:\ of a Windows path, or nothing for a path without one. Why: windowsDriveRoot: the drive letter feeds a fixed PowerShell query.