Forum Discussion
JagadeeshN0807
Apr 04, 2022Copper Contributor
CreateFileA() API not creating a file with FILE_ATTRIBUTE_NORMAL.
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!
No RepliesBe the first to reply