.LOCK

Файл LOCK

Задать вопрос
БЫСТРЫЙ ОТВЕТ

A .lock file is a marker that a program is actively using a file, database, or profile. It is usually empty or holds a tiny text note such as a process ID. You do not open or edit it. If an app crashed and left a stale .lock that blocks you, close the program fully and delete the file.

Разработчик: N/A (generic OS/application convention) Категория: Другие файлы MIME: application/octet-stream
ОТКРЫВАЕТСЯ НА Windows macOS Linux
Связанные: .TORRENT · .MSO · .MD5 · .SHS

На этой странице

Проиндексировано расширений: 19k+
Последняя проверка: Jul 29, 2026

Не знаете, что это за файл?

Перетащите любой файл в наш идентификатор - мы прочитаем первые байты, чтобы определить формат.

Идентифицировать файл

Что такое формат файла LOCK?

A .lock file is used to lock a resource or file, supported by various operating systems and programs. When files or resources are accessed concurrently by multiple processes or users, the .lock file signals other applications to wait until the resource is released. The .lock file is typically an empty (zero-byte) file; however, it can contain a short plain-text payload - such as a process ID (PID), hostname, username, or timestamp - depending on which application created it. .lock files are widely supported on Linux, macOS, Windows, and other platforms, going well beyond the early Unix-based systems where the convention originated.

There is no fixed internal format or magic number; the file's mere existence indicates the resource is in use. A second important application of .lock is in modern package managers: tools like npm (package-lock.json), Yarn (yarn.lock), Cargo (Cargo.lock), and Bundler (Gemfile.lock) write structured dependency manifests under this same extension to pin exact versions and ensure reproducible builds.

Related formats include .tmp temporary files and .pid process-ID files, which serve similar operational roles.

Безопасность и защита

РИСК: LOW

A .lock file is inert - it cannot run and usually contains nothing. The only real risk is deleting one while the owning program is genuinely active, which can cause two processes to write the same database/file simultaneously and corrupt it. Always close/verify the owning app first. A .lock left behind by ransomware-style malware is a different thing entirely (it marks an encrypted file); if .lock files appear suddenly on many personal documents, treat it as a possible ransomware indicator, not a normal lock.

Детали формата

в двух словах
ПОЛНОЕ НАЗВАНИЕLock Fileтакже известен как lockfile, exclusive-access marker
РАЗРАБОТЧИКN/A (generic OS/application convention)с Long-standing Unix convention (1970s-1980s); used across many OSes and apps
КАТЕГОРИЯДругие файлы
MIME-ТИПapplication/octet-stream
ТИПMarker/sentinel file - usually empty or a tiny text stub (no fixed format)
СВЯЗАННЫЕ.torrent.mso.md5.shs
Это расширение также используется в…
  • Package-manager dependency lock file - Files like Cargo.lock, Gemfile.lock, yarn.lock, poetry.lock, flake.lock pin exact dependency versions - real, editable text manifests, not empty markers.
  • Application profile/session lock - Browsers and apps (e.g. Firefox profile .parentlock, LibreOffice .~lock files) create a lock to stop a second instance opening the same profile/document.

Программы, открывающие файлы LOCK

Windows2 apps
Windows Notepad Встроенная Right-click -> Open with -> Notepad only to peek at any text (PID/owner); most are empty. Don't keep it open.
Notepad Открытый код Open the .lock as plain text to read any embedded PID/path; useful for diagnosing stale locks.
macOS1 app
TextEdit Встроенная Open the .lock as plain text to inspect any payload; usually it's empty.
Linux1 app
Any text editor (gedit, nano, less) Открытый код 'cat file.lock' or open in an editor to read a PID/owner; 'lsof'/'fuser' show which process holds it.

Технические подробности

глубокая спецификация
Mechanism typeAdvisory (cooperative) locking: applications must voluntarily check for the file; the OS does not enforce exclusion
Lock signalMere existence of the file indicates the resource is held - no contents required
Typical file size0 bytes to a few KB; the vast majority are 0 bytes (empty sentinel)
Body encodingEmpty, or plain-text ASCII/UTF-8 - PID, hostname, username, file path, or timestamp
Magic bytes / headerNone - no magic number or fixed header; identified by name and extension only
Platform supportLinux, Unix, macOS, Windows; cross-platform by convention
LifecycleCreated by the owning process when it acquires the resource; deleted on clean release
Stale lock riskIf the owning process crashes without cleanup, the .lock file must be manually removed to restore access
Structured variantPackage manager manifests (package-lock.json, Gemfile.lock, Cargo.lock, yarn.lock, poetry.lock) share the extension but contain structured dependency data
Common applicationsText editors (LibreOffice, vim), databases (SQLite), browsers (Firefox profile), package managers (npm, Yarn, Bundler, Cargo, Poetry)
OS-level alternativeflock/fcntl on Unix, LockFileEx on Windows - often used alongside lock files for stronger guarantees
MIME typeapplication/octet-stream (empty/binary) or text/plain (text payload)
ВыпущенLong-standing Unix convention (1970s-1980s); used across many OSes and apps
Последняя версияN/A - no single specification; meaning is defined per application

Конвертации LOCK

Вопросы и ответы сообщества

спрошено пользователями
Задать быстрый вопрос
Получите помощь от людей, работающих с файлами LOCK. Будьте конкретны - укажите вашу систему и версию ПО.
Аккаунт не нужен · ответы обычно в течение дня

Вопросов пока нет - станьте первым, кто спросит о файлах LOCK.

Часто задаваемые вопросы

What is a .lock file and can I open it?
It's a marker that a program is using a resource. There's usually nothing inside to open - it may be empty or hold a small text note (a PID/owner). You can peek with a text editor, but it isn't meant to be opened.
Is it safe to delete a .lock file?
Yes, if the program that created it is fully closed/not running - that clears a stale lock. Deleting one while the app is actively using the resource can corrupt the underlying file or database.
An app says the file is locked and won't open - how do I fix it?
Close every copy of the program (and check Task Manager/ps for leftover processes), then delete the orphaned .lock file next to the document/database and reopen.
Why does a .lock keep coming back?
Because the program recreates it every time it opens the resource - that's normal. It should disappear when the app closes cleanly; if it persists, the app likely crashed or is still running in the background.
Should I commit Cargo.lock / yarn.lock / Gemfile.lock to git?
Those are dependency lock files (a different use of .lock) - real text manifests pinning versions. For applications you generally commit them; for libraries the convention varies by ecosystem.
Lots of my documents suddenly have a .lock added - is that ransomware?
Possibly. Some ransomware appends .lock to encrypted files. Normal locks sit next to a file in use, not on dozens of personal documents at once. Disconnect and scan if files also won't open.

Ссылки

1Wikipedia - File locking (advisory vs mandatory)en.wikipedia.org
2Linux man pages - flock(2) / lockfile conventionsman7.org

Узнать больше

по всей базе данных

Популярные расширения на этой неделе

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.MDMarkdown Document
4.BINCD/DVD Disc Image (BIN/CUE)
5.NOMEDIAAndroid No-Media Marker File
6.PARTPartial Download File
7.RPMSGRestricted Permission Message
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.DBSQLite Database File

Похожие расширения

.TORRENTBitTorrent Metainfo File
.MSOMicrosoft Office HTML/OLE Data Stream (oledata.mso)
.MD5MD5 Checksum File
.SHSShell Scrap Object File
.DDDAdobe Acrobat Distiller file
.DWLDrawing Lock File (CAD)

Бесплатные инструменты для файлов

Идентификатор файлов и конвертер изображений в браузере - все работает на вашем устройстве.

Открыть инструменты

Обзор расширений файлов A-Z