CreateFileA() API not creating a file with FILE_ATTRIBUTE_NORMAL.

Copper Contributor

I am using CreateFileA() API to create a file with FILE_ATTRIBUTE_NORMAL.

code:

hndl_w = CreateFileA((LPCSTR)filename, GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);

DOWRD dwAttrs = GetFileAttributesA((LPCSTR)filename);

dwAttrs is returning as 32(0x20) which means file is getting created with FILE_ATTRIBUTE_ARCHIVE.

Can anyone please help me in solving this issue.

Thank you!

0 Replies