Skip to content

PathCompatibilityProfile

The naming rules of one platform.

Import:

import type { PathCompatibilityProfile } from '@mnaoumov/obsidian-lib/path-compatibility';

Signature:

export interface PathCompatibilityProfile

Properties

PropertyTypeDescription
hasWindowsNamingRulesbooleanWhether this platform applies Windows' naming rules: its forbidden characters, its reserved device names, and its rejection of trailing dots and spaces.

One flag for three rules because they are one filesystem's rules, and no platform adopts a subset.
maxFilePathLengthnumberThe longest absolute path a file may have, in this profile's unit.
maxFolderPathLengthnumberThe longest absolute path a folder may have, in this profile's unit.

Below PathCompatibilityProfile.maxFilePathLength on Windows, where the shorter budget leaves room for an 8.3 name inside the folder.
maxNameLengthnumberThe longest single name — one path segment — in this profile's unit.
platformPathCompatibilityPlatformThe platform this profile describes.
shouldMeasureInBytesbooleanWhether lengths count UTF-8 bytes (ext4, APFS) rather than UTF-16 units (NTFS).

This is the whole reason the 255 limit is not a character count: a name of 128 CJK characters is 384 bytes and is rejected by ext4 while being nowhere near any limit Windows has.