mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:33:16 +00:00
19 lines
389 B
C
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;
|
|
}
|