Skip to content

docs(touch): record NTFS literal-glob platform deviation and test exemption (issue #1143) - #1167

Merged
caomengxuan666 merged 1 commit into
mainfrom
fix/1143-ntfs-noise
Oct 12, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
fix/1143-ntfs-noise

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

背景

#1143(noise-platform:NTFS 上与 GNU 的噪音差异)的行为修复已由 #1152 合入 main(7d94253):touch -c 'x*x' 对齐 GNU,按缺失文件静默跳过、退出码 0;单元测试覆盖三种场景。本 PR 补齐该 issue 中 b 类(Windows 平台本质差异)项要求的文档化处置:写明理由与测试豁免。

逐条判定(对照 WSL GNU bash 5.3.0 + GNU coreutils,2026-10-12 复测)

issue repro 项 GNU 行为 WinuxCmd 行为 判定 处置
touch 'x*x' rc=0,创建字面量文件 rc=1,cannot touch b 平台本质差异:* 是 NTFS/Win32 非法文件名字符,该文件不可能存在,无法对齐 #1152 已在源码注释与测试注释写明理由;本 PR 补 DOCS 平台差异记录
ls 'x*x' rc=0(因 GNU touch 创建成功) rc=2(文件缺失) b 派生差异:文件在 NTFS 上不可能存在,按缺失报错即正确行为 同上,文档注明差异仅源于 GNU 侧创建成功
touch -c 'x*x' rc=0 静默 rc=0 静默(#1152 修复后) a 已对齐 无需再动
测试断言 — touch_unmatched_glob_literal_reports_ntfs_error 在所有平台断言 Windows 行为并注明理由 c 已平台化(#1152) 本 PR 在 DOCS 中登记该豁免

改动

验证

I18N

纯文档改动,不含用户可见的运行时/帮助文本,无需更新 winuxcmd-i18n 目录。

Closes #1143(若维护者认为文档化即可完全关闭;issue 当前已因 #1152 关闭)

@caomengxuan666
caomengxuan666 merged commit ba501ec into main Oct 12, 2026
4 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/1143-ntfs-noise branch October 13, 2026 02:09
caomengxuan666 added a commit that referenced this pull request Oct 13, 2026
…u/sed, CHANGELOG #1167/#1169 (#1178)

* fix(seq): batch stdout into 64 KiB chunks + integral to_chars fast path (issue #1173)

safePrint issues one WriteFile per call, so per-line emission paid a kernel
transition two-three times per line (~30us/line piped; 100k lines ~332ms
while GNU needs ~5ms). Lines now assemble into a 64 KiB buffer flushed in
large chunks, integral first/increment sequences (default fixed format,
precision 0, no --format/-w, |operands| <= 2^52) emit through std::to_chars
like GNU seq.c's integer bypass, and the floating path drops the per-line
size-query snprintf round trip.

100k lines, release build: seq 332ms -> ~45ms, seq | wc 903ms -> ~45ms
(GNU/WSL oracle: 7-10ms; residual is the ~40ms Windows process spawn).
Byte stream unchanged: new seq_large_range_buffered_output_matches_gnu_bytes
pins 588895 bytes/100000 lines across several flush rounds.

* fix(du,sed): POSIX drive-form operands resolve through the shared boundary (issue #1174)

du rejected '/d/...' operands with ENOENT while accepting 'D:/...' and sed
could not read them either — the L2 self-parse contract (tools resolve POSIX
operands themselves) was unevenly applied. Both now route operands through
native_path::make_api_path_operand_w/normalize_api_operand, the same
boundary grep/wc/head/find already use:

- du: traversal operands (and -X exclude files, --files0-from sources) fold
  '/d/src', '/cygdrive/d/src' and /dev pseudo-paths to their Win32 form;
  operand line and child entries agree on the resolved forward-slashed
  spelling (Savannah #13956) while the #1159 trailing-separator collapse and
  error messages keep the operand text as typed.
- sed: input operands (glob patterns included) fold before expansion/open,
  and with -i the folded path is what gets replaced; -f script files and the
  r/w/W script-embedded paths resolve the same way. Diagnostics and the
  '='/F filename display keep the operand text as typed.

GNU oracle (WSL coreutils): du -sh /usr -> '8.5G /usr' rc=0. New tests cover
the dual forms: du -sh '/d/...' vs 'D:/...', sed -n 1p, sed -i and sed -f
through '/d/...' paths.

* docs(changelog): record the #1167 ntfs-noise docs round and #1169 spawn resolver in [Unreleased] (issue #1175)

#1169 (GNU execvp-style child resolution: PATH-only bare-name search with no
cwd/System32 shadowing, POSIX PATH spellings normalized) and #1167 (touch
NTFS literal-glob platform deviation documented, test exemption registered)
were merged without a CHANGELOG entry. PR #1171's own fixes (#1170/#1168/
#1166) were already recorded at merge time (d4210c7), so no duplicate entry
is added for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

touch: cannot create a literal-glob filename like 'x*x' (NTFS-illegal character, platform noise)

1 participant