reactos/reactos/lib/crtdll/io/chmod.c
Boudewijn Dekker e8cbdde2a7 moved some header files from top level to crtdll directory
svn path=/trunk/; revision=365
1999-04-02 21:44:11 +00:00

19 lines
389 B
C

#include <windows.h>
#include <crtdll/io.h>
int
_chmod(const char *filename, int func)
{
DWORD FileAttributes = 0;
if ( func == _S_IREAD )
FileAttributes &= FILE_ATTRIBUTE_READONLY;
if ( ((func & _S_IREAD) == _S_IREAD) && ((func & _S_IWRITE) == _S_IWRITE) )
FileAttributes &= FILE_ATTRIBUTE_NORMAL;
if ( SetFileAttributes(filename,func) == FALSE )
return -1;
return 1;
}