删除具有重新分析点的文件夹 [英] Delete a folder with reparse point

查看:84
本文介绍了删除具有重新分析点的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


在我的软件中,我正在创建一个带有重新分析点的文件夹,其中可能包含用户数据。删除我的软件后,我将文件夹留在后面。


问题是用户无法通过Windows资源管理器删除此文件夹。尝试删除其中包含重新分析点文件夹的常规文件夹时,问题更加严重。它只是停止没有错误消息或指示出错的地方。只有在使用fsutil删除重新分析点后才能删除
文件夹。 


是否有另一个选项而不必运行fsutil命令而不是以编程方式执行此操作?


提前致谢,


Yaniv

解决方案

您好Yaniv,


感谢您在此发帖。


您可以使用另一种方法删除重新分析点。它是
DeviceIoControl
方法。  


 
DeviceIoControl
function使您可以设置,修改,获取和删除重新分析点。



FSCTL_DELETE_REPARSE_POINT
操作将删除现有的重新分析点。


注意:


如果要修改,获取或删除重新分析点,则必须在文件中包含的操作中指定相同的重新分析标记。否则,操作将失败并显示错误
ERROR_REPARSE_TAG_MISMATCH 。如果要修改或删除重新分析点,则还必须在文件中包含的操作中指定重新分析
GUID 。否则,操作将失败并显示错误
ERROR_REPARSE_ATTRIBUTE_CONFLICT


我希望回复对您有所帮助。


最好的问候,


Hart





Hello,

In my software, I'm creating a folder with reparse point which may contain user data. After the removal of my software I leave the folder behind.

The problem is that the user cannot delete this folder via windows explorer. The problem is more severe when trying to delete a regular folder with a reparse point folder inside it. It just stop with no error message or indication to what went wrong. The folder can be deleted only after removing the reparse point using fsutil. 

Is there another option without having to run the fsutil command and not doing it programmatically?

Thanks in advance,

Yaniv

解决方案

Hi Yaniv,

Thank you for posting here.

You can use the another method to remove the reparse point. it is DeviceIoControl method.  

The  DeviceIoControl function enables you to set, modify, obtain, and remove reparse points.

The FSCTL_DELETE_REPARSE_POINT operation will remove an existing reparse point.

Note:

If you are modifying, getting, or deleting a reparse point, you must specify the same reparse tag in the operation that is contained in the file. Otherwise, the operation will fail with the error ERROR_REPARSE_TAG_MISMATCH. If you are modifying or deleting a reparse point, you must also specify the reparse GUID in the operation that is contained in the file. Otherwise, the operation will fail with the error ERROR_REPARSE_ATTRIBUTE_CONFLICT.

I hope that the reply would be helpful for you.

Best Regards,

Hart


这篇关于删除具有重新分析点的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆