The Current attributes are:
[Rw-A------------------]
I want to change the attributes to:
[Ro--------------------]
What I get (using the code snip below) is the following:
[Ro----------------DIRI]
where DI is "Delete Inhibit" and RI is "Rename Inhibit."
Why are the DI and RI attributes appearing? Is this a bug with the
ChangeDirectoryEntry() function that has just hung around for years?
Does anyone know how to keep the "DI" and "RI" attributes from appearing?
Thanks,
Paul
<<<<<<<<<<<<<<<<<<<<<<<<< Code Snip Follows
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* Modify structure mask values */
#define MModifyNameBit 0x0001
#define MFileAttributesBit 0x0002
#define MCreateDateBit 0x0004
#define MCreateTimeBit 0x0008
#define MOwnerIDBit 0x0010
#define MLastArchivedDateBit 0x0020
#define MLastArchivedTimeBit 0x0040
#define MLastArchivedIDBit 0x0080
#define MLastUpdatedDateBit 0x0100
#define MLastUpdatedTimeBit 0x0200
#define MLastUpdatedIDBit 0x0400
#define MLastAccessedDateBit 0x0800
#define MInheritanceRestrictionMaskBit 0x1000
#define MMaximumSpaceBit 0x2000
#define MLastUpdatedInSecondsBit 0x4000
/* File Attributes */
#define _A_NORMAL 0x00 /* Normal file - read/write permitted
*/
#define _A_RDONLY 0x01 /* Read-only file
*/
#define _A_HIDDEN 0x02 /* Hidden file
*/
#define _A_SYSTEM 0x04 /* System file
*/
#define _A_EXECUTE 0x08 /* Execute only file
*/
#define _A_SUBDIR 0x10 /* Subdirectory
*/
#define _A_ARCH 0x20 /* Archive file
*/
#define _A_SHARE 0x80 /* Used for compatibility with DOS
software */
/* that is not network aware
*/
/* Extended attributes: (NYI means Not Yet Implemented)
*/
#define _A_TRANS 0x00001000 /* Transactional - file will use TTS
*/
#define _A_READAUD 0x00004000 /* Read audit - NYI in NW386 V3.1
*/
#define _A_WRITAUD 0x00008000 /* Write audit - NYI in NW386 V3.1
*/
#define _A_IMMPURG 0x00010000L /* Immediate purge
*/
#define _A_NORENAM 0x00020000L /* Mac rename inhibit
*/
#define _A_NODELET 0x00040000L /* Mac delete inhibit
*/
#define _A_NOCOPY 0x00080000L /* Mac copy inhibit
*/
typedef struct
{
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 MInheritanceGrantMask;
WORD MInheritanceRevokeMask;
int MMaximumSpace;
LONG MLastUpdatedInSeconds;
} NWModifyStructure;
LONG resetBits = 0L;
NWModifyStructure resetInfo;
// Clear file attributes
memset(&resetInfo, '0', sizeof(NWModifyStructure));
resetBits |= MFileAttributesBit;
resetInfo.MFileAttributesMask = -1;
resetInfo.MFileAttributes = 0x00000001; // Also tried: _A_RDONLY
ChangeDirectoryEntry(path, &resetInfo, resetBits, 1);
Its a longstanding feature of NetWare. Set Ro and you get RoDiRi. I'm not
aware of any way around this.
John
DevSup SysOp 24