|Everything HP200LX: Knowledge, Products, Service|
Deleting "read-only" files
If you try to delete a file from within FILER and you get an error box saying, "Cannot delete read-only file," (see Screen 1) one of two things is happening. First, it's possible that the file you're trying to delete is open in an application. Go back into the application in which the file was created (for example, Database, or PhoneBook) and Quit the application. You should now be able to return to FILER and delete the file.
Screen 1: Trying to delete a read-only file is not the only action that can produce this Error box.
Second, it is possible that the file's attribute is set to "read-only." (Often, after downloading a file from the Internet, I discover that the file's attribute has been set to "read-only.") If your file is set to "read-only," although you will be able to "read" the file (i.e., load it into MEMO or another program, or TYPE it from DOS, or View it in FILER) you won't be able to alter it or delete it unless you disable the read-only attribute. (The "read-only" attribute is a hidden code stored with a file's directory.)
To find out whether the file's read-only attribute is enabled or disabled, go into DOS and go to the drive and directory where the file is located. Then use the DOS ATTRIB command. Type
ATTRIB filename [RETURN]
Insert in the place of "filename" the name of the file that you're not able to delete. (Alternately, you can just type ATTRIB without specifying a file name. This will produce a list of all the files in that directory, along with each file's attribute.) If the file is read-only, you'll see something like the following:
The "R" means that the file OLD.EXE (which is on the A:\ drive) has its read-only attribute enabled.
To disable the file's read-only attribute, type
ATTRIB -r OLD.EXE
Alternately, you could type:
ATTRIB -r *.*
This will remove the read-only status from all files in that directory (*.* means "all files.")
In some situations, you might want to enable, rather than disable, a file's read-only status. For example, maybe you have a MEMO file that you don't want anyone else to alter or delete (or you want to prevent yourself from mistakenly deleting).
To enable read-only status on a file, you would type at the DOS prompt:
ATTRIB +r OLD.EXE
To sum up, "-r" in conjunction with the ATTRIB command disables read-only status, whereas "+r" enables it.
Ralph C. Turner
The HP Palmtop Paper
Copyright © 2010 Thaddeus Computing Inc