萝卜L

导航

Windows 获取文件的实际路径、名字(大小写敏感)

  • lfs._VERSION>=1.8
  •  lfs.symlinkattributes(file path).target (如果是软连接,则返回的是最终硬链接的文件路径,而非软链接或者其目标软链接的路径)
  • function GetActualFileName(d,fn)
        --d: directory, fn: filename
        fn=string.lower(fn)
        for en in lfs.dir(d) do
            --    en: entry name
            if string.lower(en)==fn then
                return en
            end
        end
    end

     

posted on 2021-02-06 11:17  萝卜L  阅读(215)  评论(0编辑  收藏  举报