Vscode-remote-release: Downloading a remote file from explorer does not overwrite a local file with the same name when there is no extension in the filename.

Created on 14 Nov 2019  路  7Comments  路  Source: microsoft/vscode-remote-release

  • VSCode Version: 1.40
  • Local OS Version: Windows 10 enterprise 10.0.18363
  • Remote OS Version: Ubuntu 18.04 LTS
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. Create a file on local named "testfile" (no extension).
  2. Connect to remote SSH server and open a folder
  3. Right click a file in the explorer and click download. Click on your local testfile and overwrite it through this download menu (Save as type: All Files)
  4. Observe that the contents on local haven't actually been overwritten

Repeating the above steps with the file named "testfile.txt", the overwrite actually occurs.

bug file-explorer verified

All 7 comments

I am using the fileService.copy
I could pass the overwrite flag but that is not what I want. I would expect the fileService to find a new name and copy without overwriting.

@isidorn

I would expect the fileService to find a new name and copy without overwriting.

The file service is not the right place for that, it takes a path and does something with it, but will not start to come up with new file names if there is a conflict. You will have to come up with a filename from the outside if there is a conflict.

Think about the file service like node.js FS API. It is pretty much that.

Ok, so the download would have to do something similar to the copy.
Would have to check if there are overwrites and come up with a new name.
Marking as a feature request for now and we can tackle in the future.

Same problem here but occurs with file extension. Tried it on multiple files and filetypes.

VSCode 1.40.2

Same here. I was attempting to download a local copy of a build artifact through SSH remote, and couldn't understand my results at all until I realised that the file transfer was refusing to overwrite despite the dialog which asked me to confirm that I want to overwrite.

Thanks for the fix :) looking forward to the release.

Was this page helpful?
0 / 5 - 0 ratings