Skip to content

VS Code Locks file fter changes and empties the file #230169

@amithegde

Description

@amithegde

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version:
    Version: 1.93.1 (system setup)
    Commit: 38c31bc
    Date: 2024-09-11T17:20:05.685Z
    Electron: 30.4.0
    ElectronBuildId: 10073054
    Chromium: 124.0.6367.243
    Node.js: 20.15.1
    V8: 12.4.254.20-electron.0
    OS: Windows_NT x64 10.0.26100
  • OS Version: Windows 24H2 OS BUILD 26100.742

Steps to Reproduce:
This may not be exact repro stesps, but It happens often on my machine.

  1. Open project directory on VS Code from elevated prompt
  2. Modify file, say for example, Ctrl+Shift+P > Convert indentation to spaces

Try to save the file, and there is this error: Failed to save 'MyFileName.cpp': Unable to write file 'q:\src\ys\src\er\MyFileName.cpp' (Unknown (FileSystemError): Error: EBUSY: resource busy or locked, open 'q:\src\ys\src\er\MyFileName.cpp')
If I retry, it doesn't work, if I revert, the file will become empty and all chagnes will be lost including the file contents.

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions