Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> dirownidget() / dirownidset()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DirOwnIDGet() / DirOwnIDSet()
------------------------------------------------------------------------------
 Purpose:
 Get / set a directory's owner object ID.

 Syntax:
 dwObjID = DirOwnIDGet( lpszPath )
 dwObjID = DirOwnIDGet( lpszPath, dwNewID )

 Parameters:
 lpszPath The full NetWare path name of the directory.
 dwNewID  The new owner ID.

 Returns:
 A numeric value (unsigned long int).

 Description:
 DirOwnIDGet() returns the object ID of the user that owns or created
 the directory specified by lpszPath which must be the full path of the
 directory including the volume name, e.g. SYS:PUBLIC\MSDOS.

 DirOwnIDSet() sets the owner of the specified directory lpszPath to the
 value specified by dwNewID and returns the previous owner ID.

 Returns NOVERRLONG if an error occurs.

 Example:
 // To return who created (owns) the directory SYS:DATA\WP:

 lpszOwnerName = UsrNameGet( DirOwnIDGet( "SYS:DATA\WP" ))
 if ( !empty( lpszOwnerName ) )
    ? "Directory SYS:DATA\WP is owned by", lpszOwnerName
 endif

 // To change the owner of directory SYS:DATA\WP to KATIE:

 dwNewOwner = UsrIDGet("KATIE")
 dwOldOwner = DirOwnIDSet( "SYS:DATA\WP", dwNewOwner )
 lpszOldName = UsrNameGet( dwOldOwner )
 lpszNewName = UsrNameGet( dwNewOwner )
 ? "Directory SYS:DATA\WP was owned by", lpszOldName
 ? "Directory SYS:DATA\WP is now owned by", lpszNewName

 Notes:
 Use UsrNameGet() to turn the object ID number into a name.
 Appropriate trustee access rights are required. When changing the Owner ID,
 make sure it is changed to a valid Object ID number.

See Also: DirSubDirLst() DirCreDteGet() / DirCreDteSet() DirCreTmeGet() / DirCreTmeSet() UsrNameGet()

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