Skip to content

Add uss copy command to ZRS backend#787

Open
MarkAckert wants to merge 20 commits intomainfrom
user/markackert/uss-copy
Open

Add uss copy command to ZRS backend#787
MarkAckert wants to merge 20 commits intomainfrom
user/markackert/uss-copy

Conversation

@MarkAckert
Copy link
Member

@MarkAckert MarkAckert commented Feb 10, 2026

What It Does
Adds a zowex uss copy command which is essentially a pass-through for the UNIX cp command utility. There are a few key differences from cp:

  • This command does not support arbitrary cp command flags. It surfaces a few USS-related flags (-R, -L, -p).

  • Currently, uss copy always uses -p by default, which is not the default behavior for USS cp. The -p flag preserves file and directory attributes in the output directory, which was requested as part of Implement copy for USS files and directories #379. If this flag is unset, copied files appear to match the permission structure of the current directory.

    • For example, in a 755 directory with file abc set to 777, running cp abc def yields a file with 755 permissions. running cp -p abc def yields def with 777 permissions.
  • Globbing and special characters will not be supported.

    • If a user gives us: zowe uss copy abc* def, the glob is expanded before reaching our code, and the command will fail if there is >1 match for abc* (too many arguments).
    • If a user gives us: copy uss copy "abc*" def, the * is a character literal and the command looks for the exact file matching abc*.
  • Copy to/from datasets is currently possible, but not practical since this command doesn't surface cp flags related to dataset handling. I'm not explicitly scanning the input parameters for DS syntax and erroring out.

  • run_shell_command is moved from ztso.cpp into zut.cpp ( Z Utilities?).

I have a few implementation questions left:

  • Should we match USS cp exactly, or should we default to -p?
    • follow-up: if we opt to keep -p by default, what should the flag to disable it be called? We currently block flags/arguments from using no as a prefix.
  • Do we want to scan for dataset syntax and error out?
  • Do we want to support -f flag? (Attempts to remove and replace destination files that can't be opened, which happens when a destination's files are read-only and won't be overwritten).

Testing complete. Some unknowns:

  • Why is the zut test case for run_shell_command not capturing stdout? Is this an issue everywhere or just in the test case?

How to Test
Run the zusf and zowex uss test cases.

Review Checklist
I certify that I have:

Additional Comments
Comments in What it does section.

Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Feb 10, 2026

Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
@MarkAckert MarkAckert marked this pull request as ready for review February 12, 2026 19:38
@zowe-robot zowe-robot moved this from In Progress to Review/QA in Zowe CLI Squad Feb 12, 2026
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>
Signed-off-by: MarkAckert <35308966+MarkAckert@users.noreply.github.com>

## `0.2.3`

- `c`: Implement `zowex uss copy` command to copy USS files and directories.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please change verb to past tense: Implemented ...
  • Add an issue or PR link

Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review/QA

Development

Successfully merging this pull request may close these issues.

3 participants

Comments