-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Remote drive: Execute permission removed from file on save when saving #12309
Comments
Reproduced with a Windows VM on OSX editing a file that is on the OSX filesystem. There the permissions go from -rwxr-xr-x to -rw-r--r-- after saving. The Finder shows a new creation date. Saving the file with VSCode on OSX does not change the permissions and the Finder shows the old creation date. |
Upstream issue which very likely reproduces with bare node.js too. |
@PunchyRascal @chrmarti if you can write a node.js script which runs |
EDIT: this is about Nope, running the following code, where foo.txt is on the remote drive: const fs = require('fs');
fs.appendFile('z:/foo.txt', 'data to append2', (err) => {
if (err) throw err;
console.log('The "data to append" was appended to file!');
}); does not remove the execute permission. The data is written to the file. |
Sorry, I used |
@PunchyRascal please report this to node.js then. |
@PunchyRascal maybe you first try our insider build which comes with a much newer node.js release (6.3.0): |
(just a technical note, the link seems to be http://code.visualstudio.com/insiders) |
Nope, still there. Anyway I reproduced this even with a script running on node 6.6. However, there seem to be some shenanigans concerning the file permission, see nodejs/node-v0.x-archive#25756 I can't really tell if what they say there solves this issue ATM. |
Same here. I found the following preserves the permissions (and possibly other metadata):
|
@chrmarti but did you try going through the remote drive to see if it preserves executable bit there too? |
@bpasero I ran that code in my Windows VM with a workspace that is on the host OSX filesystem. On OSX ls -l would show the executable bits set before and after. writeFile() would loose them. There are no attributes shown when looking at the file from the Windows VM's file explorer (if that's what you're referring to). |
Ok, going via fs.write might be an option to workaround this. I still think that writeFile could be better though so I encourage to file an issue against node.js itself 👍 |
I filed nodejs/node#9380 Actually it works also for |
I don't know what happened, but don't experience this issue anymore. Executable files seem to keep their x right. |
Weird, I do not recall any change in this area for a while. |
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: