创建文件 - CreateFile
函数简介
在指定路径创建一个新的空文件。
接口名称
CreateFile
DLL调用
int CreateFile(long instance, string path);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| path | 字符串 | 要创建的文件完整路径。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 创建文件
int ret = CreateFile(instance, "C:\\test\\hello.txt");
// 检查文件是否创建成功
int exists = IsFile(instance, "C:\\test\\hello.txt");
Python
# 待补充
返回值
1 成功,0 失败。
注意事项
- 若文件已存在,具体行为取决于底层实现(可能覆盖或失败)。
