Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Book 4-Appendices - <b>nnetrights()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NNETRIGHTS()
 Tests for access rights to a Novell file server directory
------------------------------------------------------------------------------
 Syntax

     NNETRIGHTS(<cPath>) --> nBitMap

     Netware: 2.2 and 3.11

 Argument

     <cPath>  Designates the complete path, including the drive
     designation for the directory that is tested.

 Returns

     NNETRIGHTS() returns a value between 0 and 255 that corresponds to a bit
     map for the related directory rights.  A right is present when the
     designated bit is set at 1.

     Table 23.14:  Access Right Coding
     ------------------------------------------------------------------------
     Bit     Definition     Description
     ------------------------------------------------------------------------
     1       READ           Read from files
     2       WRITE          Write to files
     3       OPEN           Open files
     4       CREATE         Create new files
     5       DELETE         Delete files
     6       PARENTAL       Create subdirectories
     7       SEARCH         Search for files in directories
     8       MODIFY         Change file names or attributes
     ------------------------------------------------------------------------

     Beginning with NETWARE386 version 3.0, the numeric range for the access
     rights coding has been extended from 1 bit up to 9 bits.  Additionally,
     the meaning of the individual bits has been changed according to the
     following table.

     Table 23.15:  Access Right Coding
     ------------------------------------------------------------------------
     Bit     Definition     Description
     ------------------------------------------------------------------------
     1       READ           Read from files
     2       WRITE          Write to files
     3       RESERVED
     4       CREATE         Create new files
     5       ERASE          Delete files
     6       ACCESS CONTROL Trustee rights can be changed
     7       FILE SCAN      Search for files in directories
     8       MODIFY         Change file names or attributes
     9       SUPERVISORY    All rights / can assign access rights
     ------------------------------------------------------------------------

     With an invalid parameter, the function returns 0 (which equates to no
     rights).

 Description

     This function determines the access rights to a directory of a Novell
     file server.  The parameter must always relate the complete path to the
     root directory and must include the drive designation.  The construction
     of this type of absolute path can be done with the aid of functions like
     DIRNAME(), DISKNAME(), and TRUENAME().

     You can determine if a Novell network is active and if a drive is
     resident on a file server with the NETDISK() and NNETWORK() functions.

 Note

     .  This function always returns a value of 511 for a local drive
        and displays full rights to the designated directory.

 Examples

     .  Display the rights to the CA-Clipper directory on drive J:

        ? NNETRIGHTS("J:\CLIPPER")                // Returns numeric
                                                  // value

     .  Test for a particular right:

        ? ISBIT(NNETRIGHTS("J:\CLIPPER"), 6)      // Allowed to create
                                                  // a directory

     .  Display the rights in the current directory:

        ? NNETRIGHTS(DISKNAME() + ":" + DIRNAME())

     .  Rights depend on the version:

        cDrive := "J:"
        IF NNETVER(cDrive) < "3.00"
           ? BITTOC(NNETRIGHTS(cDrive+"\CLIPPER"), "MSPDCOWR", .T.)
        ELSE
           ? BITTOC(NNETRIGHTS(cDrive+"\CLIPPER"), "SMFAEC WR", .T.)
        ENDIF

See Also: NETDISK() NNETWORK()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson