_chmod
Syntax
| #include <io.h>
int _chmod(const char *filename, int func, mode_t mode);
|
Description
This is a direct connection to the MS-DOS chmod function call, int
0x21, %ax = 0x4300/0x4301. If func is 0, then DOS is called with
AX = 0x4300, which returns an attribute byte of a file. If func
is 1, then the attributes of a file are set as specified in mode.
Note that the directory and volume attribute bits must always be 0 when
_chmod()
is called with func = 1, or else the call will fail.
The third argument is optional when getting attributes.
The attribute bits are defined as follows:
| Bit Meaning
76543210
.......1 Read-only
......1. Hidden
.....1.. System
....1... Volume Label
...1.... Directory
..1..... Archive
xx...... Reserved (used by some network redirectors)
|
On platforms where the LFN API (see section LFN) is available,
_chmod
calls function 0x7143 of Interrupt 21h, to support long
file names.
Return Value
If the file exists, _chmod()
returns its attribute byte in case
it succeded, or -1 in case of failure.
Portability