Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

LOCK AmigaDOS
Purpose: Sets the write-protect status of a device.
Format: LOCK=<drive> [ON | OFF] [<passkey>]
Template: DRIVE/A, ON/S, OFF/S, PASSKEY
Path: C:LOCK
LOCK sets or unsets the write-protect status of a device or partition. The LOCK remains on until the system is rebooted or until the LOCK is turned off with the LOCK OFF command.

An optional passkey can be specified. If the passkey is used to lock a hard disk partition, the same passkey must be specified to unlock the partition. The passkey can be any number of characters long.

You can read the contents of the locked device or partition with commands such as DIR, LIST, or MORE but you cannot alter the contents. If you try to edit the contents of a file on a locked device or partition an error message will be displayed.

Locking a device is only good for the duration of the current session. Resetting or turning off the Amiga cancels the lock.

Example 1:

To lock the partition, enter:

3.OS4:> LOCK Work: ON SecretCode The Work partition is locked. You can read the contents of Work with commands such as DIR, LIST, or MORE but you cannot alter the contents of the partition. If you try to edit the contents of a file on Work, a requester indicates that Work is write-protected. For example, if you try to create a new directory by entering the following: 3.OS4:> MAKEDIR WORK:Test
Can't create directory Work:Test
the error message appears because the disk is write-protected.

Example 2:

To unlock the partition, enter:

3.OS4:> LOCK Work: OFF SecretCode


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.