参考所有分组:替换陈旧OPFS参数备份

结论:按 LinuxCNC rs274ngc_pre.cc save_parameters() 先 unlink 旧 .bak 再 link 当前参数文件的语义,浏览器 OPFS 成功保存时总是用解析前主参数文件刷新 .bak;未扩展 smoke 解析行为。

验证:./test-native.sh;./test-linuxcnc-source-link.sh;./test-web-wasm-browser-smoke.sh。
This commit is contained in:
cnc
2026-06-03 11:11:40 +08:00
parent 1928ff3b6a
commit f98a715ed7
2 changed files with 7 additions and 8 deletions

View File

@@ -713,7 +713,7 @@ export async function createWasmSimulator(moduleOptions = {}) {
// through the WASM mirror, so preserve the loaded OPFS file here.
if (previousParameterFile === null) {
await opfs.removeFile(`${parameterPath}.bak`);
} else if (!(await opfs.exists(`${parameterPath}.bak`))) {
} else {
await opfs.writeFile(`${parameterPath}.bak`, previousParameterFile);
}
return events;