Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
45cade6
fix: publish one list of install variables to clear
HaoZeke Nov 19, 2026
167e899
fix: report a failed release of the state-root lock
HaoZeke Nov 20, 2026
2444e27
test: share the open-descriptor count
HaoZeke Nov 20, 2026
fd54a1b
test: share the forked-child wait
HaoZeke Nov 20, 2026
4c2643a
test: report keepAboveStdio failure when no free descriptor remains
HaoZeke Nov 20, 2026
800af99
test: count descriptors around the keepAboveStdio paths in proc
HaoZeke Nov 20, 2026
5d49f1e
Merge pull request #87 from stackhands/main
HaoZeke Nov 24, 2026
48107dc
Merge branch 'develop' into fix/env-scrub-policy
HaoZeke Nov 24, 2026
c723b1d
Merge branch 'develop' into test/keep-above-stdio-emfile-fdcount
HaoZeke Nov 24, 2026
49f1575
Merge pull request #47 from stackhands/fix/env-scrub-policy
HaoZeke Nov 24, 2026
4276d17
Merge pull request #80 from stackhands/test/keep-above-stdio-emfile-f…
HaoZeke Nov 24, 2026
2d442d1
feat: report the step a gzipInPlace error came from
HaoZeke Nov 20, 2026
68f0fe4
Merge pull request #82 from stackhands/feat/gzip-step-report
HaoZeke Nov 25, 2026
1afcbaf
docs: list GzipStep and gzipInPlaceAtStep
HaoZeke Nov 25, 2026
48ca228
docs: state what an archive error leaves in logs.GzipStep
HaoZeke Nov 25, 2026
af16d58
test: share the scratch directory setup in test_support
HaoZeke Nov 25, 2026
49bfe5a
Merge pull request #88 from stackhands/docs/gzip-step-nits
HaoZeke Nov 25, 2026
acd7fb4
test: check that `RootLock.release` returns a failed lock call
HaoZeke Nov 25, 2026
a45142a
Merge pull request #89 from stackhands/fix/lock-release-error
HaoZeke Nov 25, 2026
5d37a99
fix: return a failed close from state.writePrivate before the rename
HaoZeke Nov 25, 2026
1c6bf4d
test: check that state.writePrivate returns a failed fsync or close
HaoZeke Nov 25, 2026
9cc29f1
Merge pull request #90 from stackhands/fix/write-private-close
HaoZeke Nov 25, 2026
deb32fb
fix: check the close of atomically written files
HaoZeke Nov 25, 2026
dfb49d3
fix: check the close of files fsx publishes
HaoZeke Nov 25, 2026
1a33654
Merge pull request #91 from stackhands/fix/atomic-write-close
HaoZeke Nov 25, 2026
76ef0ba
Merge pull request #92 from stackhands/fix/fsx-close-check
HaoZeke Nov 25, 2026
02a4005
fix: check the close of logs gzip writes
HaoZeke Nov 26, 2026
9948dcd
fix: check the close of lines fsx appends
HaoZeke Nov 26, 2026
be9b092
Merge pull request #93 from stackhands/fix/logs-gzip-close-check
HaoZeke Nov 26, 2026
f363938
Merge pull request #94 from stackhands/fix/fsx-appendline-close-check
HaoZeke Nov 26, 2026
41d6380
fix: check the close of private files state creates
HaoZeke Nov 26, 2026
fcb4a71
Merge pull request #95 from stackhands/fix/state-createprivate-close-…
HaoZeke Nov 26, 2026
2a0f5e6
fix: check directory closes after sync
HaoZeke Nov 26, 2026
de0b226
Merge pull request #96 from stackhands/fix/dir-close-after-sync-v2
HaoZeke Nov 26, 2026
062d3c9
docs: list argparse in the README and eb-local in COMPAT
HaoZeke Nov 26, 2026
6712bd5
docs(compat): eb-local 3.5.0 already ships against 0.13.0
HaoZeke Nov 26, 2026
52cdcd6
docs: add CITATION.cff
HaoZeke Nov 26, 2026
89aca83
fix: check the close of files copyTo publishes
HaoZeke Nov 26, 2026
33c0333
Merge pull request #98 from stackhands/fix/fsx-copyto-close
HaoZeke Nov 26, 2026
62f7337
fix: check the close of the temp directory probe
HaoZeke Nov 26, 2026
a7d63ba
Merge pull request #99 from stackhands/fix/tempdir-probe-close
HaoZeke Nov 26, 2026
5dd60c6
Merge pull request #97 from stackhands/docs/readme-matches-code
HaoZeke Nov 26, 2026
ac3e91b
test: drop four checks the suite already makes
HaoZeke Nov 26, 2026
993200c
test: fold near-copy cases into six tables
HaoZeke Nov 26, 2026
58b3145
test: fake the host PATH. Fake the doc file. Stub `connect`.
HaoZeke Nov 26, 2026
a76de27
test: shorten sleeps, samples, and tempdir spawns
HaoZeke Nov 26, 2026
ea7e3a1
test: make the signal and link checks deterministic
HaoZeke Nov 26, 2026
e0e309a
Merge pull request #100 from stackhands/test/trim-suite
HaoZeke Nov 26, 2026
ebcbd5b
fix: report a removed cwd from absPath
HaoZeke Nov 26, 2026
ce15584
Merge pull request #101 from stackhands/fix/abspath-removed-cwd
HaoZeke Nov 26, 2026
467458b
docs: note what the getcwd fallback swallows
HaoZeke Nov 26, 2026
e110304
chore(release): prepare zig-common 0.14.0
HaoZeke Nov 26, 2026
42acdfe
Merge pull request #102 from stackhands/chore/release-0.14.0
HaoZeke Nov 27, 2026
831c49e
chore(version): v0.14.0
HaoZeke Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# of Python 3.14; the parity test skips its comparison under another.
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
python-version: "3.14.10"
- run: zig fmt --check build.zig build.zig.zon src tests
- run: zig build test --summary all
- name: parity with python's json and text calls
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
python3 tests/test_gettempdir_parity.py
- name: parity with python 3.14 argparse calls
run: |
python3 -c "import sys; assert sys.version_info >= (3, 14), 'argparse parity needs Python 3.14+; found ' + sys.version.split()[0]"
python3 -c "import sys; assert sys.version_info[:3] == (3, 14, 10), 'argparse parity is pinned to Python 3.14.10; found ' + sys.version.split()[0]"
zig build argparse-parity-probe
python3 tests/test_argparse_parity.py
- name: no site names in the tree
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build the documentation the way `pixi run -e docs docbld` does: Org export,
# API pages from the code, Sphinx with warnings and unresolved references as
# errors, the Zig autodoc site, and the internal link check. External links
# are checked in their own step. On main the site is published to
# are written to a report and do not fail the build. On main the site is published to
# https://stackhands.github.io/zig-common/.
name: docs

Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
DOCS_SOURCE_REF: ${{ github.sha }}

- name: External links
run: pixi run -e docs linkcheck
run: pixi run -e docs linkcheck > docs/build/linkcheck-report.txt 2>&1 || true
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@

<!-- towncrier release notes start -->

## 0.14.0 (2026-11-26)

### Features

- `env_scrub.childClearNames` returns the install-location names in
`src/env-scrub.json`, in the order `eb-local env` prints them.
- `logs.gzipInPlaceAtStep` compresses a log as `logs.gzipInPlace` does, and on an error sets a `logs.GzipStep` that says whether the error came before the archive was in place (`archive`) or from the sync of its directory afterwards (`directory_sync`). `gzipInPlace` keeps its signature and calls it.

### Fixes

- `atomic.atomicWrite` and `atomic.atomicWriteAt` sync and close the temporary file before renaming it over the destination. A failed close is returned as `sys.Error`, the destination is left as it was, and the temporary file is removed. `atomicWrite` puts that errno in `why` with no path, as it does for a failed write or fsync. Before this change, `atomicWrite` ignored the close, and `atomicWriteAt` closed only after the rename and ignored the result. A write that the Network File System (NFS) reported lost at the close then replaced the destination and was returned as success. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. The call is replaceable through `atomic.ops.close` in the same builds as the other `atomic.ops` calls.
- `fsx.TempDir.get` does not keep a directory whose probe file close fails, so a write that a network file system (NFS) reported lost at the close is not committed as the temporary directory. The probe file is removed. A close that `EINTR` interrupts counts as success and is not retried. The close goes through `fsx.temp_probe_ops`.
- `fsx.absPath` returns `Error` as well as `Allocator.Error` in its error set, which is a source-breaking change for callers that switch exhaustively on its errors. It handles a removed working directory, reporting `error.NotFound`.
- `fsx.appendLine` closes the list after the line is written and returns that close. A failed close is returned as `sys.Error` with `sys.last_errno` set. The line is not removed, because the descriptor is already gone and the file is not shortened back to its old size. Before this change the close result was ignored, so a write that a network file system (NFS) reported lost at the close was returned as success. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. The close is replaceable through `fsx.publish_ops` in the same builds as `atomic.ops`. A cleanup close on an earlier error still ignores its result so the earlier error keeps its errno.
- `fsx.copyTo` closes the temporary file before the rename that publishes it. A failed close is returned with `sys.last_errno` set, the destination keeps its old contents, and the temporary file is removed. A close that `EINTR` interrupts counts as success and is not retried. The caller still gets an open descriptor of the published file.
- `fsx.moveAcross` closes a copied directory after syncing it and before the rename that publishes the copy, including each directory of a copied tree. `fsx.copyTo` and `moveAcross` close the parent directory after the sync that makes the new name durable. `atomic.fsyncDir` and the parent directory sync in `atomic.atomicWrite` check that close as well, as does the directory sync at the end of `logs.gzipInPlace`. A failed close is returned as `sys.Error`. A close on the way out of an earlier error is ignored and that errno is kept. Before this change those closes were ignored, so a directory sync that a network file system (NFS) reported lost only at the close was returned as success. Before the rename, a failure leaves the destination name as it was and removes the temporary path. After the rename, the published name keeps what the rename put there. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. The closes go through `fsx.publish_ops`, `atomic.ops.close` and `logs.gzip_ops` in the same builds as the other replaceable calls.
- `fsx.replaceContents` closes the file before the rename that publishes it. So does the cross-device copy inside `fsx.moveAcross`, for a regular file and for each regular file of a copied tree. A failed close is returned as `sys.Error`, the destination is left as it was, and the temporary path is removed. Before this change, the close of `replaceContents` ran after the rename, and the copy ignored the result of its close. A write that the Network File System (NFS) reported lost at the close was then published and returned as success. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. The close is replaceable through `fsx.publish_ops` in the same builds as `atomic.ops`.
- `logs.gzipInPlace` and `logs.gzipInPlaceAtStep` sync and close the temporary archive before renaming it over `name.gz`. A failed close is returned as `sys.Error`, the temporary file is removed, and the log and any existing archive are left as they were. Before this change the archive was closed after the rename and the close error was dropped, so a write that a network file system (NFS) reported lost at the close published `name.gz`, removed the log, and was returned as success. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. The call is replaceable through `logs.gzip_ops` in the same builds as `atomic.ops`.
- `state.RootLock.release` reports a failed release of the state-root lock. It closes both lock files and returns the first error as `sys.Error`. It used to drop that error, so callers that discarded the result have to handle it.
- `state.createPrivateAt` returns a failed close of the file it creates as `sys.Error`, with that errno in `sys.last_errno`. The created name is left in place, including when the close fails. Before this change the close was ignored, so a write that a network file system (NFS) reported lost at the close was returned as success. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. After an earlier error, the cleanup close ignores its result and keeps that error's errno. The close goes through `state.write_ops.close`, the same replaceable call `state.writePrivate` uses.
- `state.writePrivate` syncs and closes the temporary file before it renames it over the name. A failed fsync or close is returned as `sys.Error`, the name is left as it was, and the temporary file is removed. Before this change the file was closed after the rename and the close error was dropped, so a write that a network file system (NFS) reported lost at the close replaced the name and was returned as success. A close that `EINTR` interrupts is not retried and is not an error, as `sys.result` treats `EINTR`. The calls are replaceable through `state.write_ops` in the same builds as `state.lock_ops`.

### Documentation

- The API reference and the compress-and-mark-logs how-to list `logs.GzipStep` and `logs.gzipInPlaceAtStep`, and the how-to shows how to read the step an error came from.
- The README module table lists `argparse`, and COMPAT.md names eb-local as a consumer of 0.13.0.
- `logs.GzipStep` says that an `archive` error from opening `name` changes nothing, so a `name` that was already absent stays absent and any `name.gz` already there is left alone, that after a later `archive` error the original is still there and `name.gz` is absent unless it existed before or both the removal of the original and the removal of the archive failed, and that `directory_sync` follows one rename and one unlink.

### Miscellaneous

- Add a descriptor count around the `proc` paths that call `sys.keepAboveStdio`, checking `/proc/self/fd` before and after so a leaked descriptor fails the test.
- Add a test that `state.RootLock.release` returns the error when the `fcntl` or `flock` release fails through `state.lock_ops`, returns the record lock error when both fail, and closes both lock descriptors in each case.
- Add a test that `sys.keepAboveStdio` returns `error.Unexpected` and leaves the original descriptor open when duplication fails with `EMFILE`.
- Add tests that `state.writePrivate` returns a failed `fsync` or `close` injected through `state.write_ops`, closes the descriptor once, leaves the name and no temporary file, retries an `fsync` that `EINTR` interrupts, and treats a `close` that `EINTR` interrupts as success without a retry.
- Move the forked-child wait that retries an interrupted `wait4` into the shared test helper.
- Move the open-descriptor count into a shared test helper and return an error when reading `/proc/self/fd` fails.
- Move the scratch directory the `logs` tests and the `fsx` `moveAcross` fixture make into `test_support.ScratchDir`, which removes a directory left by an earlier run of the same pid before it creates its own.
- Prepare `zig-common` `0.14.0` in `COMPAT.md` for callers of `fsx.absPath`, whose error set now includes `Error` as well as `Allocator.Error`.


## 0.13.0 (2026-11-24)

### Features
Expand Down
20 changes: 20 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cff-version: 1.2.0
title: 'zig-common: the Linux Zig library under the stackhands tools'
message: If you use zig-common, please cite it using the metadata below.
type: software
authors:
- given-names: Rohit
family-names: Goswami
email: rgoswami@ieee.org
orcid: https://orcid.org/0000-0002-2393-8056
license: MIT
repository-code: https://github.com/stackhands/zig-common
url: https://stackhands.github.io/zig-common/
keywords:
- Zig
- Linux
- system calls
- atomic writes
abstract: 'Linux-only Zig library shared by the stackhands tools: system calls with
named errors, descriptor-checked file handling, child processes, atomic ACL-preserving
writes, Python-compatible JSON, text and argparse, and syslog or journald events.'
3 changes: 2 additions & 1 deletion COMPAT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

| zig-common | Zig | tools built on it |
|---|---|---|
| 0.13.0 | 0.17.1 | eb-keep-logs and eessi-arch-guard on their next releases (`syslog` without the functions that take no `Identity`; `emitFor` and `send` are unchanged); eb-keep-logs builds against it in CI |
| 0.14.0 | 0.17.1 | eb-local, eb-keep-logs and eessi-arch-guard on their next releases (`fsx.absPath` returns `Error` as well as `Allocator.Error`; a removed working directory is `error.NotFound`); eb-keep-logs builds against it in CI |
| 0.13.0 | 0.17.1 | eb-local 3.5.0; eb-keep-logs and eessi-arch-guard on their next releases (`syslog` without the functions that take no `Identity`; `emitFor` and `send` are unchanged); eb-keep-logs builds against it in CI |
| 0.12.0 | 0.17.1 | eb-keep-logs (`syslog.emitFor` with its own `Identity`) and eessi-arch-guard (`syslog.send`, the transport under its own formatting) on their next releases; eb-keep-logs builds against it in CI |
| 0.11.0 | 0.17.1 | eb-keep-logs and eessi-arch-guard on their next releases (`syslog`: the RFC 5424 and journald emitter each carried a copy of); eb-keep-logs builds against it in CI |
| 0.10.0 | 0.17.1 | eessi-arch-guard and eb-staged-rebuild (`fsx.mkdtemp`, `fsx.normPath`, `fsx.absPath`); eb-keep-logs builds against it in CI |
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ the entry and its hash.
| `sys` | `std.os.linux` calls with EINTR retried and errno mapped to a Zig error set |
| `fsx` | open without following a final symbolic link, checks on the descriptor (`fstat`), a copy that renames into place so a short write does not destroy the destination, line append, atomic replace keeping owner, mode and access ACLs, cross-filesystem move with strict or portable ACL handling, directory iteration, `rm -rf` that never follows links, `realpath` through `/proc/self/fd` |
| `proc` | run a program by absolute path with an empty signal mask, default handlers and no descriptors above 2, by default in its own session; stdin fed and stdout and stderr read at once, each with a cap; an optional deadline, SIGTERM, a grace period, SIGKILL to the process group; a cancel flag a signal handler can set; group members left after the child exits are killed before it is reaped; `which` looks a name up in an explicit PATH |
| `logs` | `gzip -9` in place with gzip's header (name, mtime, OS byte), owner, mode and times kept; rewrite of `.licensed-logs` entries |
| `logs` | `gzip -9` in place with gzip's header (name, mtime, OS byte), owner, mode and times kept; the temporary archive is closed before it is renamed; rewrite of `.licensed-logs` entries |
| `env` | the environment as raw bytes with getenv's first-entry rule, duplicate names found, a child environment built with each name once, shell name check |
| `state` | private files in a shared directory: trusted only when the open file is a regular file of this user with one link and no group or other bits, a lock trusted the same way, atomic 0600 writes; `RootLock`, a flock gate plus a POSIX record lock on a sidecar, with a deadline read from the clock. The gate and the sidecar must each be a regular file of this user with one link |
| `json` | a JSON reader with Python's two string encodings (surrogateescape text, one byte per code point), Python values, and `json.dumps(indent=N, sort_keys=True)` byte for byte, float repr included |
| `pytext` | byte strings as Python text: the surrogateescape character, the 'replace' decoder, str.isspace, strip and split, shlex.quote |
| `atomic` | `atomic_write`: replace a file only after its bytes, owner, mode and every ACL form (GPFS NFSv4, NFSv4, POSIX access) are durable and read back; fault points before write, fsync and rename |
| `atomic` | `atomic_write`: replace a file only after its bytes, owner, mode and every ACL form (GPFS NFSv4, NFSv4, POSIX access) are durable and read back, and the temporary file has been closed; fault points before write, fsync and rename |
| `syslog` | events to a collector: a `unix:`, `journal:`, `udp:` or `tcp:` target, RFC 5424 and native journald framing for the `Identity` the caller names, and `send`, the transport alone, with a timeout; nothing here fails the caller |
| `cli` | messages to stdout and stderr that ignore a closed stream, exit code 2 for a refused invocation, the version line |
| `argparse` | a declarative argument parser compatible with Python 3.14 argparse, with a lenient policy preset for Slurm TaskProlog tools |

## Test

Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = .zig_common,
.version = "0.13.0",
.version = "0.14.0",
.fingerprint = 0xa9bcabd6798f1690,
.minimum_zig_version = "0.17.1",
.dependencies = .{},
Expand Down
17 changes: 16 additions & 1 deletion docs/orgmode/howto/compress-and-mark-logs.org
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Such a log is marked by a line in its directory's =.licensed-logs= list, which n
#+end_src

Each archive keeps the log's mode and its access and modification times, and its header carries the log's name.
The archive is written under a temporary name and renamed into place, and only then is the log removed.
The archive is written under a temporary name, flushed, synced and closed, then renamed into place, and only then is the log removed. A failed close leaves the log as it was and removes the temporary file.

3. Rewrite the list when it names any of them:

Expand Down Expand Up @@ -92,9 +92,24 @@ The archives keep the logs' mode, 0600, and their modification time, 10:15.
| =error.SymLink= | the name is a symbolic link | compress the file it points to, in its own directory |
| =error.InvalidArgument= | the name is a directory, a named pipe or a device | pass the names of regular files only |

The errors share one set, so an error alone does not say whether the log was compressed.
[[zig:zig_common.logs.gzipInPlaceAtStep]] is =gzipInPlace= that also sets a [[zig:zig_common.logs.GzipStep]] to the step the error came from:

#+begin_src zig
var failed_at: common.logs.GzipStep = undefined;
common.logs.gzipInPlaceAtStep(gpa, init.io, dir, name, &failed_at) catch |err| switch (failed_at) {
.archive => return err,
.directory_sync => {},
};
#+end_src

With =archive=, the log is where it was, and the call tries to remove any =NAME.gz= it made.
With =directory_sync=, =NAME.gz= is in place and the log is gone, and only whether that survives a crash is in doubt: count the log as compressed and rename it in the list.

** Related

- [[zig:zig_common.logs.GzipError]]: the errors =gzipInPlace= returns.
- [[zig:zig_common.logs.GzipStep]]: the steps =gzipInPlaceAtStep= reports.
- [[zig:zig_common.logs.licensed_list]]: the list's name and format.
- [[https://github.com/stackhands/eb-keep-logs][eb-keep-logs]], which writes the list and rotates log trees.
- [[https://www.gnu.org/software/gzip/manual/gzip.html][The gzip manual]], for the format and the checks.
2 changes: 1 addition & 1 deletion docs/orgmode/howto/keep-private-state-in-tmp.org
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Use this when a tool keeps a small file between runs in a directory every user m
#+end_src

[[zig:zig_common.state.readPrivate]] returns null for a file that is absent, larger than the limit or not private, so the tool starts over instead of trusting it.
[[zig:zig_common.state.writePrivate]] writes =.NAME.PID.RANDOM.tmp= with mode 0600 and renames it over the name.
[[zig:zig_common.state.writePrivate]] writes =.NAME.PID.RANDOM.tmp= with mode 0600, syncs and closes it, and renames it over the name only when the sync and the close both succeed.

** Check that it worked

Expand Down
2 changes: 1 addition & 1 deletion docs/orgmode/howto/move-a-path-across-file-systems.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Use this when a tool moves a file or directory from one mounted file system to another and must not leave a partial destination, such as moving reproduction output from =/tmp= to =/project/results=.
[[zig:zig_common.fsx.moveAcross]] tries =rename= first.
When the kernel returns cross-device, it copies to a temporary path in the destination directory, syncs it, renames it over the destination name, and only then removes the source.
When the kernel returns cross-device, it copies to a temporary path in the destination directory, syncs and closes each copied regular file, renames that path over the destination name only when those closes succeed, and only then removes the source.
The destination is the old path or the fully copied path, never a partial tree.

** Before you start
Expand Down
Loading
Loading