Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy progress in 7.4 preview 3 does not work if files are in a single directory and does not show correct total to copy #19600

Closed
5 tasks done
jhoneill opened this issue May 2, 2023 · 6 comments · Fixed by #20517
Assignees
Labels
Committee-Reviewed PS-Committee has reviewed this and made a decision In-PR Indicates that a PR is out for the issue PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed WG-Interactive-Console the console experience

Comments

@jhoneill
Copy link

jhoneill commented May 2, 2023

Prerequisites

Steps to reproduce

I have a digital camera memory card with a root folder DCIM and 3 sub folders - the first contains ~ 250 files, the second 500 files and the third ~250 files. Average size is 44MB Roughly 44 GB to copy.

Copy speed from my card reader is ~100MB/sec, so copying the recent files from one folder will take 1-2 minutes, and the new progress bar would be nice.

copy D:\DCIM\140PENTX\* C:\temp\deleteme\ -Recurse
Displays no progress

copy D:\DCIM\* C:\temp\deleteme\ -Recurse
Displays progress as in the video at #18735 HOWEVER it only shows the count of files and number of bytes to copy for the first directory. ie. instead of 1000 files /44 GB it shows 251 files,

Expected behavior

All large copies show progress

Actual behavior

Copying a lot of data from one directory does not.

Error details

No error. Command runs, but shows no progress.

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.0-preview.3
PSEdition                      Core
GitCommitId                    7.4.0-preview.3
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

Untitled.video.mp4
@jhoneill jhoneill added the Needs-Triage The issue is new and needs to be triaged by a work group. label May 2, 2023
@SteveL-MSFT
Copy link
Member

SteveL-MSFT commented Oct 2, 2023

The problem is that when copying a single folder, it's just a single .NET API call, so there's no way to know and write progress. We would have to split it into individual copy calls to be able to render progress which would slow down the operation. I think the best we could do is show a "progress" pane with the total number of files to be copied, but it wouldn't show progress, just that copying was happening.

If the WG decides not to add a static progress pane, then we should at least document this behavior so it's not surprising.

@SteveL-MSFT SteveL-MSFT added WG-Interactive-Console the console experience WG-NeedsReview Needs a review by the labeled Working Group labels Oct 2, 2023
@sdwheeler sdwheeler added PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed and removed Needs-Triage The issue is new and needs to be triaged by a work group. WG-NeedsReview Needs a review by the labeled Working Group labels Oct 18, 2023
@theJasonHelmick theJasonHelmick added the Review - Committee The PR/Issue needs a review from the PowerShell Committee label Oct 18, 2023
@theJasonHelmick
Copy link
Collaborator

theJasonHelmick commented Oct 18, 2023

Thank you @jhoneill -- The Interactive WG reviewed this issue. The implementation of this feature is not fully understood and needs further investigation. We are planning to address this during the 7.5 development timeframe.

@SteveL-MSFT
Copy link
Member

@PowerShell/powershell-committee discussed this. We can investigate showing a static progress message when copying lots of files that don't result in subfolders being copied.

@SteveL-MSFT SteveL-MSFT added Committee-Reviewed PS-Committee has reviewed this and made a decision and removed Review - Committee The PR/Issue needs a review from the PowerShell Committee labels Oct 18, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR Indicates that a PR is out for the issue label Oct 18, 2023
@jhoneill
Copy link
Author

The problem is that when copying a single folder, it's just a single .NET API call, so there's no way to know and write progress. We would have to split it into individual copy calls to be able to render progress which would slow down the operation. I think the best we could do is show a "progress" pane with the total number of files to be copied, but it wouldn't show progress, just that copying was happening.

If the WG decides not to add a static progress pane, then we should at least document this behavior so it's not surprising.
Yeah, I suspect for my case - copying dozens or a few hundred large files, the overhead of making one call per file is not significant. For the reverse case - copying thousands of small files the overhead of the extra copy calls and updating the progress after each one probably is. It's not at all clear what's best overall but it's unlikely that one choice will delight everyone. (I'm not wholly against saying 'if you want copy with progress, use the GUI or Robocopy, but it's not really expected in a shell')

The issue I reported above was it actually reports wrong information, the numbers given being the first directory of multiple ones.

@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-service bot commented Oct 19, 2023

📣 Hey @jhoneill, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://forms.office.com/r/P926k48jRJ

@SteveL-MSFT
Copy link
Member

@jhoneill just had a fix merged in, can you check if this is still a problem after we have a release with that change (or if you're adventurous build that branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Committee-Reviewed PS-Committee has reviewed this and made a decision In-PR Indicates that a PR is out for the issue PowerShell-Docs needed The PR was reviewed and a PowerShell Docs update is needed WG-Interactive-Console the console experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants