1.writefile的ubuntu 内核源码安装使用
writefile的使用
#include "windows.h"
#include "iostream"
int main()
{
HANDLE fileHandle;
fileHandle=CreateFile("d:\\Hello.txt", GENERIC_WRITE, FILE_SHARE_WRITE, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
//如果使用OPEN_EXISTING则不会创建文件
if(fileHandle == INVALID_HANDLE_VALUE)
return 1;
char *data="/";
DWORD a = ;
unsigned long b;
OVERLAPPED c;
WriteFile(fileHandle, data, a, &b, NULL);
return 0;
}
参考资料:解读VC++编程中的文件操作API和CFile类