Note: This API call is for DOS and Win16 personality only. Use Family API for portability.
2 and higher
“CHMOD” - SET FILE ATTRIBUTES
AX = 4301h CX = new file attributes (see #01420) DS:DX -> ASCIZ filename
CF clear if successful
AX destroyed CF set on error AX = error code (01h,02h,03h,05h) (see #01680 at AH=59h)
will not change volume label or directory attribute bits, but will change the other attribute bits of a directory (the directory bit must be cleared to successfully change the other attributes of a directory, but the directory will not be changed to a normal file as a result)
MS-DOS 4.01 reportedly closes the file if it is currently open
for security reasons, the Novell NetWare execute-only bit can never be cleared; the file must be deleted and recreated
under the FlashTek X-32 DOS extender, the filename pointer is in DS:EDX
DOS 5.0 SHARE will close the file if it is currently open in sharing-compatibility mode, otherwise a sharing violation critical error is generated if the file is currently open
DR DOS 3.41/5.0 will silently ignore attempts to change the 'directory' attribute bit
Bitfields for file attributes:
Bit(s) | Description |
---|---|
7 | shareable (Novell NetWare) |
7 | pending deleted files (Novell DOS, OpenDOS) |
6 | unused |
5 | archive |
4 | directory |
3 | volume label |
3 | execute-only (Novell NetWare) |
2 | system |
1 | hidden |
0 | read-only |
Text based on Ralf Brown Interrupt List Release 61
osFree Macro Library | |
---|---|
Video I/O | @SetMode @SetCurSz @SetCurPos @GetCur @SetPage @ScrollUp @ScrollDn @Scroll @GetChAtr @PutChAtr @PutCh @SetPalet @SetColor @SetDot @GetDot @WrtTTY @VideoState @GetMode @GetDisplay @GetVideoState @GetEGAInfo @Cls |
Hardware info | @Equipment @MemSize |
Serial I/O | @AuxInit @AuxSendChar @AuxRecieveChar @AuxStatus |
Tape I/O | @TapeOn @TapeOff @TapeRead @TapeWrite |
Keyboard I/O | @KbdStatus @CharIn @CharPeek |
Printer I/O | @PrnPrint @PrnInit @PrnStatus |
Disk I/O | @DskReset @DskStatus @DskRead @DskWrite @DskVerify @DskFormat |
Date and Time | @SetTime @GetTime |
Mouse | @MouInit @MouShowPointer @MouStatus @MouSetPos @MouSetMickey @MouRegion |
Memory manager | @ModBlok SET_BLOCK |