使用U盘时,特殊意外情况下(如直接拨出u盘,传输文件过程中拨出U盘)创建LOST.DIR,客户需要移除LOST.DIR文件夹

在挂载U盘时,如果在传输文件或直接拔出U盘,可能会创建LOST.DIR文件夹。此更改涉及在Ntfs.cpp和Vfat.cpp中调整代码,以避免在特定条件下创建LOST.DIR。当访问LOST.DIR失败时,原本会尝试创建该目录,但现在这部分被注释掉了。
摘要由CSDN通过智能技术生成

diff --git a/fs/Ntfs.cpp b/fs/Ntfs.cpp
index d24276f..eec31ce 100755
--- a/fs/Ntfs.cpp
+++ b/fs/Ntfs.cpp
@@ -107,18 +107,18 @@ status_t Mount(const std::string& source, const std::string& target, bool ro, bo
 
     rc = ForkExecvp(cmd);    
 
-    if (rc == 0 && createLost) {
-        auto lost_path = android::base::StringPrintf("%s/LOST.DIR", target.c_str());
-        if (access(lost_path.c_str(), F_OK)) {
+   // if (rc == 0 && createLost) {
+      //  auto lost_path = android::base::StringPrintf("%s/LOST.DIR", target.c_str());
+       // if (access(lost_path.c_str(), F_OK)) {
             /*
              * Create a LOST.DIR in the root so we have somewhere to put
              * lost cluster chains (fsck_msdos doesn't currently do this)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值