Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Mode lost after saving the file to the server #4

Closed
pwwang opened this issue May 25, 2018 · 3 comments
Closed

Mode lost after saving the file to the server #4

pwwang opened this issue May 25, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@pwwang
Copy link

pwwang commented May 25, 2018

The mode is 777 before I save it through VSCode:

-rwxrwxrwx 1 user group 1.9K May 25 14:20 proc.py

After I save it, it's changed to 666:

-rw-rw-rw- 1 user group 1.9K May 25 14:23 proc.py

The executable permission is lost. Can we try to keep it?

@mkloubert mkloubert added the enhancement New feature or request label May 26, 2018
@mkloubert
Copy link
Owner

mkloubert commented May 26, 2018

@pwwang

Since version 0.22.0 there is a new parameter, called mode:

  • You can define an octal value, which will be applied to all files and folder, like mode=644
  • or you can define a path to a JSON file, which contains the mappings as object:
{
    "644": "**/*.py",
    "777": [ "/*.txt" ]
}

The last matching pattern wins.

Save your mappings to a file, like sftp_mappings.json inside your home directory, e.g., and setup the parameter with the path to that file, like mode=sftp_mappings.json.

Relative paths will be mapped to the user's home directory.

@pwwang
Copy link
Author

pwwang commented May 29, 2018

@mkloubert
Thanks for the update. But is it possible to read and save the permissions while pull the files from the server and grant the same permissions while push them to the server?

@mkloubert
Copy link
Owner

@pwwang

I released a new version 0.23.0, which does try to keep the permission value of an existing file by default now.

This can be controlled by new keepMode parameter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants