When a user opens a file using the Egnyte Desktop App, the file is automatically locked in the cloud to prevent other users from overwriting changes. Other users who attempt to open or edit the file will receive a notification that the file is locked for editing most applications will still allow users to edit the file in read-only mode. This occurs regardless of whether the file is opened from the cloud, a Smart Cache device, or a copy of the file that has been synchronized for offline access.
A lock lasts for as long as it is needed. It is held while the file is open in an application, and it continues to be held while changes are still waiting to upload to the cloud. The lock is released once the new version has been confirmed in the cloud.
- The file locking mechanism also reduces the chance of conflicts.
- In earlier versions of the Desktop App, a lock was released as soon as the application closed the file, even if the new version had not finished uploading. Starting from Desktop App for Windows v4.7.0, locks are held through the upload, so a file stays locked until its new version is confirmed in the cloud. Support for Mac will follow in a later release.
FAQs
A user opened a file from one computer but can still edit it from another computer where they are logged in. How is that possible if the file is locked?
Every lock is tied to a specific user so it prevents other users from editing the file. If the user logs in using the same Egnyte account that holds the lock from a different computer, the user can still edit the files. Other users will not be able to edit the file.
How does the Desktop App determine when a file should be locked?
When a user opens a file with an application, the application opens a special handle on the file to let other applications know that it has the file open. Desktop App uses this to determine when to lock the file. it only locks the file 5 seconds after the handle is opened and remains open to handle cases where applications frequently open and close files in short succession.
How does the Desktop App know how long files should remain locked?
A file remains locked for as long as either of the following is true, and the machine has an internet connection:
- The application used to open the file maintains an open handle on it.
- There are changes to the file still waiting to upload to the cloud, or an upload is in progress.
These conditions keep an existing lock in place. Neither of them creates a lock on a file that was not locked when it was opened.
When is a file unlocked in the cloud?
Files are unlocked if any of the following occur:
- The application closes the handle on the file and the latest version of the file has finished uploading to the cloud
- The upload fails permanently, after the Desktop App has exhausted its retries
- The upload is canceled because the user went offline or paused sync. The lock is released rather than left stuck on the file; see the question below
- If there is no connection to the cloud during the 90 second period when Egnyte Desktop App attempts to renew the lock. This could be either due to the machine getting shut down, going into hibernation, or internet access being lost
Why is a file still locked for other users after it was closed?
Because the upload hasn't finished yet. Closing a document writes changes to the computer; the Desktop App then uploads the new version in the background, which can take anywhere from a moment to several minutes depending on file size and connection speed. The lock is released once the cloud confirms the new version. This is expected behavior and resolves as soon as the upload completes.
What happens if a user saves a file but keeps it open?
The lock is held for the upload, then remains held because the file is still open in the application. It is released after the file is closed and its final upload completes.
If the file is saved several times in a row, the uploads queue up and the lock is not released between them — it is released once the queue is empty.
Are new files locked while they upload?
No. A file that does not yet exist in the cloud is not locked during its first upload. There is nothing to conflict with, because a new file is not visible to other users until it has finished uploading.
What happens if the user goes offline or pauses sync while a file is still uploading?
The Desktop App releases the lock rather than leaving it stuck on the file indefinitely. When the user reconnects or resumes sync, it retries the upload and re-acquires the lock where it can. If another user edited the file during that window, Egnyte's conflict detection mechanism applies and the version is preserved as a conflict copy.
Brief network interruptions are handled without releasing the lock — an upload that drops out momentarily is retried automatically and the lock is kept.
What happens if my file uploads while I don't hold the lock?
The upload goes ahead. The Desktop App does not attempt to take a lock at upload time, so it will not take a lock away from another user who holds one. If the cloud version has diverged from the local version, a conflict copy is created.
Can a file be unlocked while it is still uploading?
Yes. Anyone who can normally remove a lock — the lock holder, or an administrator — can unlock a file while its upload is in progress. Doing so removes the protection for the remainder of that upload. Locks applied manually are not affected by upload progress and stay in place until they are removed.
What happens if the Desktop App restarts while an upload is pending?
Pending uploads are stopped and restarted after the Desktop App relaunches. The lock is restored on restart, provided it has not expired in the meantime.
How does global file locking work with applications that use linked or cross-referenced files (for example, Adobe InDesign or AutoCAD)?
In applications with linked files, users will typically open a master file that links to multiple files or assets. Linked files are usually loaded into memory and then immediately closed by the application but there are cases where such files are also held open as long as the master file is open. In most situations, the master file is locked since it is held open by the application and the linked assets are not locked so they can be opened and modified by other users. However, this behavior can vary based on the application being used.
Unsupported Applications and Files
The automatic locking mechanism is not supported for applications that do not maintain an exclusive lock on a file while it is open (for example, some applications close a file after its contents are loaded into memory). Though a user would see the file as open in such applications, the Desktop App would receive a notification from the system that the file was opened and subsequently closed, after which it would release any lock on the file. In such cases, Egnyte's conflict detection mechanism would still be able to detect conflicts between multiple users.
Below are examples of file types and applications for which the file locking mechanism will not take hold due to the behavior described above:
- Adobe Illustrator (.ai)
- Adobe Photoshop (.psd)
- Text editing applications that load opened files into memory
When is a file not locked during upload
Because a lock is created only when an application opens a file, a file that was never locked is not locked while it uploads. Egnyte's conflict detection mechanism still applies in these cases, so the version is preserved as a conflict copy rather than being lost.
- Files added or updated outside an application: A file copied or pasted into the drive in File Explorer is not locked while it uploads. Locking is based on an application opening the file, and file manager operations do not take a lock.
- New files: A file that does not yet exist in the cloud is not locked during its first upload, because it is not visible to other users until that upload completes.
- Connected folders: Files in connected folders are not automatically locked, and their uploads are not lock-protected.
- Offline folders: Files in folders synced for offline access are locked while opened by application, but the lock is released once the file is closed.
- A folder renamed or moved in the cloud: If a folder is renamed or moved in the Web UI, or by another user, while one of the files inside it has a pending upload, the locks on those files are released and are not re-acquired at the new location. The upload itself still completes.
- Locking disabled by the administrator: If the Egnyte administrator has turned off automatic locking for private directories or for offline use, files covered by those settings are not locked at all.