WSL (Windows Subsystem for Linux) 和 Windows App 的檔案權限問題

WSL 在一些輕量級的 Linux application 下很好用,不過如果專案稍大一點,vim 就不夠力

這時候如果用 Windows application 同時開發,如果寫入到 home 目錄的權限,檔案的 mode 會是 000
要手動改 755 才可以編輯

WSL 執行時仍然是用執行使用者的權限,雖然也可以跑在 admin mode 但是不建議

所以要讓 WSL Linux 和 Windows 同時開發,要將程式放在 /mnt/<driver> 下
讓 Windows 管理整個權限,就不會有寫到 home 目錄之後,檔案的 mode 變 000 的狀況

ref
VSCODE cannot save file launched by WSL 18.04

Related posts

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>