Docs » Autodocs » dos.library » SetProtection
SetProtection -- Set protection for a file or directory
success = SetProtection( name, mask ) D0 D1 D2 BOOL SetProtection (STRPTR, LONG)
SetProtection() sets the protection attributes on a file or directory. See <dos/dos.h> for a listing of protection bits. Before V36, the ROM filesystem didn't respect the Read and Write bits. In V36 or later and in the FFS, the Read and Write bits are respected. The archive bit should be cleared by the filesystem whenever the file is changed. Backup utilities will generally set the bit after backing up each file. The V36 Shell looks at the execute bit, and will refuse to execute a file if it is set. Other bits will be defined in the <dos/dos.h> include files. Rather than referring to bits by number you should use the definitions in <dos/dos.h>.
name - pointer to a null-terminated string mask - the protection mask required
success - boolean
SetComment(), Examine(), ExNext(), <dos/dos.h>
|