www.digitalmars.com [Home] [Search] [CTG] [RTL] [IDDE]
Last update July 1, 2004

CHMOD: Read/Write File Attributes

chmod changes or displays the attributes for a particular file.

Command syntax:

	chmod {(+|-)attribute} [file...] 
file is the file or files of interest. Wildcards are accepted.

Using + before an attribute turns on the attribute. Using - turns off the attribute. The attributes are:

R Read only
H Hidden
S System
V Volume label
D Subdirectory
A Archive
Example: This line makes myfile.exe a read-only file:
	chmod +R myfile.exe 
If no attributes are specified, chmod displays (but does not change) the file's attributes, in this form:
	__A__SHR 0x27 IO.SYS 
Mnemonic characters denote attributes that are "on"; underscored characters indicate that an attribute is "off." Thus, chmod can be handy for finding hidden and system files:
	chmod *.*

Copyright © 1995-2004 Digital Mars. All Rights Reserved.