ruby 2.6:当文件名以点字符结尾时,File.mtime失败

问题描述 投票:-1回答:1

在使用ruby 2.6的Windows上,当文件名以点字符结尾时,mtime失败。

我尝试用反斜杠点替换点,但没有成功。谢谢你的指教。NiVa

if f =~/\.$/
              VIM::message('This is matching a point char ' +  f.to_s())
              f1 = f.gsub(/\./, '\.')
              VIM::message('So now its this filename that is passed ' + f1.to_s())
              begin
                  File.mtime(f1) 
              rescue
                VIM::message('Unable to get mtime on File "' + f1.to_s() + '"')
                VIM::message('And current path is "' + Dir.pwd.to_s() + '"')
              ensure
              end
            else
ruby
1个回答
0
投票

好简单的问题:如何获取名为“ vim”的目录的mtime。在具有红宝石功能的Windows操作系统下?

© www.soinside.com 2019 - 2024. All rights reserved.