Skip to content

2.1.0

Latest

Choose a tag to compare

@RuiNelson RuiNelson released this 08 Nov 03:13

What's New

PathWorks 2.1.0 is a correctness release. Path splitting, extension detection and NTFS checks now work on Unicode scalars, as file systems do, instead of on grapheme clusters, and the NTFS reserved-name list now matches Windows. No API is added or removed, but two fixes change results callers may notice, hence the minor bump.

Fixes

  • Separators fused into graphemes: a / combined with a combining mark or a prepended scalar (e.g. U+0600) was not treated as a separator, so .. segments could hide inside one "name" and appendingPathComponent could resolve outside its base. pathComponents, appendingPathComponent, removingLastPathComponent, intermediaryPaths and relative(to:) now split and detect absolute paths by scalar.
  • Extensions: separateExtension finds the period by scalar, so "x\u{600}.jpg" → ("x\u{600}", "jpg").
  • NTFS trailing characters and device names: "a\u{600}." (ends in a period) and "CON.\u{301}txt" (device name CON) are no longer reported safe.
  • More reserved names: COM¹ COM² COM³ LPT¹ LPT² LPT³, CONIN$, CONOUT$, and spaces before the first period ("NUL .txt" → "_NUL_ .txt"), matching CPython's ntpath.isreserved.

Behavior changes

  • samePath and relative(to:) compare components scalar by scalar: NFC "café" and NFD "café" are now different paths, as they are on NTFS and ext4.
  • "..".removingLastPathComponent is now "../.." (was ""), and directoryBaseNameAndExtensionFromPath returns nil for a path ending in ...

Docs

  • Corrected the [String].path separator note and the NTFS truncation comment.