[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]


    NAME
        SetProtection -- Set protection for a file or directory

    SYNOPSIS
        success = SetProtection( name, mask )
        D0                       D1    D2

        bool setprotection (strptr, long)

    FUNCTION
        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>.

    INPUTS
        name - pointer to a null-terminated string
        mask - the protection mask required

    RESULTS
        success - boolean

    SEE ALSO
        setcomment(), examine(), exnext(), <dos/dos.h>