Developed by DevVault Technologies.
FileLocker is a VS Code extension for teams working in the same shared network project folder. It helps stop two developers from editing the same file at the same time.
Why It Is Needed
When multiple developers work directly from one shared folder, one developer may overwrite another developer's changes by mistake.
FileLocker prevents this by locking a file when one developer opens it.
How It Works
- A developer opens a file in VS Code.
- FileLocker creates a lock inside
.vscode-file-locks. - If another developer opens the same file, FileLocker shows who locked it and blocks the file.
- When the owner closes the file tab, the file unlocks automatically.
- If VS Code closes normally, FileLocker also tries to clean up that user's locks.
The lock owner is saved like this:
username@machine-name
Lock files store the workspace-relative file path, owner name, machine name, and lock time. They do not store the user's full local file path.
Network Usage
FileLocker does not use a hardcoded IP address.
It uses the folder currently opened in VS Code. Every developer must open the same shared network folder.
Correct:
\\SERVER\Projects\FileLockerProject
Wrong:
C:\Users\DeveloperA\Desktop\FileLockerProject
C:\Users\DeveloperB\Desktop\FileLockerProject
Developer Usage
- Install the FileLocker
.vsixextension in VS Code. - Open the shared network project folder.
- Open a file to lock it.
- Close the file tab to unlock it.
Manual unlock fallback:
Ctrl + Shift + P > File Locker: Unlock Current File
Settings
FileLocker can be adjusted from VS Code settings:
{
"fileLocker.enabled": true,
"fileLocker.showLockNotifications": true
}
Turn fileLocker.enabled off when you need to temporarily disable automatic locking for a workspace.
Security Notes
FileLocker is designed to prevent accidental overwrites between trusted developers using the same shared folder. It is not a security boundary and does not replace file system permissions, source control, backups, or code review.
Anyone who can write to the shared folder can also create, delete, or edit files in .vscode-file-locks. Use normal network share permissions to control who can access the project.
Build The VSIX
Open terminal in this folder:
E:\FileLocker-main\file-locker
Run:
npm install
npm run compile
npm run vsix
This creates:
file-locker-0.0.1.vsix
Give that .vsix file to developers.
Install The VSIX
In VS Code:
Extensions > three dots menu > Install from VSIX...
Then select:
file-locker-0.0.1.vsix
Restart VS Code after installation.
Important
Every developer must install FileLocker.
Every developer must open the same shared network folder.
Add this to the shared project's .gitignore:
.vscode-file-locks/