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

Error when Download command is used on a folder #81654

Closed
roblourens opened this issue Sep 26, 2019 · 7 comments
Closed

Error when Download command is used on a folder #81654

roblourens opened this issue Sep 26, 2019 · 7 comments
Assignees
Labels
debt Code quality issues file-io File I/O remote Remote system operations issues verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

  • Connect to a remote
  • Right click on a folder in the explorer
  • Click "Download"
  • See an error notification pop up, "Unable to open '': File is a directory"

But I do get the save as dialog and can download the folder.

@isidorn
Copy link
Contributor

isidorn commented Sep 30, 2019

I am using the textFileService.saveAs.

The issue here is that the textFileService assumes that the resource passed is a file. Thus it tries to open it here

I believe this was not happening before. Did we change something in this area @bpasero

And yes it might be a bit weird that I am using the textFileService for downloading a folder. I am open for ideas.

@bpasero bpasero transferred this issue from microsoft/vscode-remote-release Sep 30, 2019
@bpasero bpasero added this to the September 2019 milestone Sep 30, 2019
@bpasero bpasero added the file-io File I/O label Sep 30, 2019
@bpasero
Copy link
Member

bpasero commented Oct 1, 2019

@isidorn this reproduces with 1.38.1 stable for me:

image

ITextFileService was never implemented in a way that you could use it with folders.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug remote Remote system operations issues labels Oct 1, 2019
@bpasero bpasero removed their assignment Oct 1, 2019
@isidorn
Copy link
Contributor

isidorn commented Oct 1, 2019

Ok, sounds like debt. Let me assign to next milestone and we can then consider if I shuold use a different service or the TextFileService should handle folder (which does not seem like a good choice)

@isidorn isidorn added debt Code quality issues and removed bug Issue identified by VS Code Team member as probable bug labels Oct 1, 2019
@isidorn isidorn modified the milestones: September 2019, October 2019 Oct 1, 2019
@bpasero
Copy link
Member

bpasero commented Oct 1, 2019

I would probably have a new service for this. And I also wonder what this command should do for a folder: should it download a zipped version of the folder or each file individually?

The ITextFileService is more for dealing with resolved text models that are opened in the system, not so much for lowlevel file io like downloading.

@isidorn
Copy link
Contributor

isidorn commented Oct 1, 2019

Downloading a zipped version sounds like too much work for the use (he has to unzip).
I think it should be more seamless, so we download the whole foder and than each file individually. If people complain that it is slow, we can introduce a heuristic such that for larger folders we download a zipped version.

@isidorn
Copy link
Contributor

isidorn commented Oct 22, 2019

From Ben: I don’t think ITextFileService is the right place for downloading a folder. I would rather manually bring up a folder picker to ask the user for the target destination and then use IFileService.copy() for the operation to that target folder.

@isidorn
Copy link
Contributor

isidorn commented Oct 23, 2019

@bpasero thanks for feedback. I am no longer using textFileService but I am using the fileDialogService and the fileService
@roblourens you can try it out and let me know how it behaves now for you. Thanks

@bpasero bpasero added the verification-needed Verification of issue is requested label Oct 23, 2019
@connor4312 connor4312 added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Oct 29, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues file-io File I/O remote Remote system operations issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants