删除文件夹 - DeleteFolder
函数简介
删除指定路径的文件夹。
接口名称
DeleteFolder
DLL调用
int DeleteFolder(long instance, string path);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| path | 字符串 | 要删除的文件夹完整路径。 |
示例
C++
long instance = CreateCOLAPlugInterFace();
// 先创建文件夹,再删除
CreateFolder(instance, "C:\\test\\tempdir");
int ret = DeleteFolder(instance, "C:\\test\\tempdir");
// 验证文件夹已被删除
int exists = IsDirectory(instance, "C:\\test\\tempdir"); // 返回0
Python
# 待补充
返回值
1 成功,0 失败。
注意事项
- 若文件夹非空,删除行为取决于底层实现(可能删除失败)。
