ChangeDirectoryEntry

Changes a directory or file entry

Local Servers:blocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
SMP Aware:No
Service:File System

Syntax

   #include <nwdir.h> 
    
    int ChangeDirectoryEntry (  
       char                     *pathName,  
       struct ModifyStructure   *modifyVector, 
       LONG                      modifyBits,  
       LONG                      allowWildCardsFlag);
   

Parameters

pathName

(IN) Specifies the directory pathname to be changed.

modifyVector

(IN) Points to a structure that specifies the new values of the directory entry’s fields.

modifyBits

(IN) Tells the function which structure fields to change.

allowWildCardsFlag

(IN) Indicates whether wildcards are allowed in the pathname:

  • Nonzero = Wildcards allowed
  • 0 = No wildcards allowed.

Return Values

Value

Hex

Constant and Definition

0

(0x00)

ESUCCESS

1

(0x01)

Invalid MOwnerID, MLastUpdatedID, MLastArchivedID, or MMaximumSpace in ModifyStructure.

NetWare Error

UNSUCCESSFUL

Remarks

This function is used to modify the fields of a file or directory entry or entries. (If wildcards are specified, then only matching files are changed.)

To call this function, complete the following steps:

  1. Indicate which fields to change out by switching on the appropriate bit in the modifyBits parameter.

    The modify bits are defined in NWFATTR.H and have the following values:

    • 0x0001L MModifyNameBit
    • 0x0002L MFileAttributesBit
    • 0x0004L MCreateDateBit
    • 0x0008L MCreateTimeBit
    • 0x0010L MOwnerIDBit
    • 0x0020L MLastArchivedDateBit
    • 0x0040L MLastArchivedTimeBit
    • 0x0080L MLastArchivedIDBit
    • 0x0100L MLastUpdatedDateBit
    • 0x0200L MLastUpdatedTimeBit
    • 0x0400L MLastUpdatedIDBit
    • 0x0800L MLastAccessedDateBit
    • 0x1000L MInheritanceRestrictionMaskBit
    • 0x2000L MMaximumSpaceBit
    • 0x4000L MLastUpdatedInSecondsBit
  2. Create or fill in the structure ModifyStructure. It is only necessary to fill in those fields to be changed (with the exception of MFileAttributesMask, see below). This structure is located in NWDIR.H and contains the following fields:

          BYTE   *MModifyName;  
          LONG   MFileAttributes;  
          LONG   MFileAttributesMask;  
          WORD   MCreateDate;  
          WORD   MCreateTime;  
          LONG  MOwnerID;  
          WORD   MLastArchivedDate;  
          WORD   MLastArchivedTime; 
          LONG   MLastArchivedID;  
          WORD   MLastUpdatedDate; 
          WORD   MLastUpdatedTime;  
          LONG   MLastUpdatedID: 
          WORD   MLastAccessedDate;  
          WORD   MIheritanceGrantMask; 
          WORD   MInheritanceRevokeMask;  
          int    MMaximumSpace; 
          LONG   MLastUpdatedInSeconds; 
       

    The MMaximumSpace field contains the number of 4K blocks.

    The MOwnerID, MLastArchivedID, and MLastUpdatedID must be in low-high order.

    The MFileAttributesMask field must be set to whatever the file’s current attributes are if you want to retain the existing file attributes in addition to the attributes you specify in the MFileAttributes field. Set the mask to -1 if you want to be able to set any file attribute.

  3. Call the function.

The current connection must have the following access rights to change the specified directory entry fields:

Attribute/Field

Required Access Rights

ReadOnly

ModifyEntry

Hidden

ModifyEntry

System

ModifyEntry

ExecuteOnly

CreateNewEntry or ModifyEntry

Subdirectory

Cannot be modified

Archive

ModifyEntry

Share

 

Transaction

ModifyEntry

ReadAudit

SupervisorPrivileges (over owner of file or directory)

WriteAudit

SupervisorPrivileges (over owner of file or directory)

ImmediatePurge

DeleteExistingEntry

MCreateDate

SupervisorPrivileges

MCreateTime

SupervisorPrivileges

MOwnerID

SupervisorPrivileges (over current and new owner)

MLastArchivedDate

ReadExistingFile or ModifyEntry

MLastArchivedTime

ReadExistingFile or ModifyEntry

MLastArchivedID

ReadExistingFile or ModifyEntry to set own ID; SupervisorPrivileges over current LastArchivedID to set ID of another object

MLastUpdatedDate

ModifyEntry or WriteExistingFile

MLastUpdatedTime

ModifyEntry or WriteExistingFile

MLastUpdatedID

ModifyEntry or WriteExistingFile to set own ID; SupervisorPrivileges over current LastUpdatedID to set ID of another object

MRightsGrantMask

ChangeAccessControl; cannot disinherit Supervisor Privileges

MRightsRevokeMask

ChangeAccessControl; cannot disinherit SupervisorPrivileges

MMaximumSpace

SupervisorPrivileges

ChangeDirectoryEntry is supported in a NetWare 2.x environment for directories only, and can only change attributes, create date and time, inherited rights, and owner ID. File entries under NetWare 2.x must still be set using SetFileInfo .

SetCurrentNameSpace sets the name space which is used for parsing the path input to this function.

NOTE:For NetWare versions before 4.x, this function only works with DOS name space for remote servers.

See Also

ModifyInheritedRightsMask, SetDirectoryInfo, SetFileInfo