ruby 2.6 : File.mtime fails when filename ends with dot char

3 views
Skip to first unread message

Ni Va

unread,
Dec 15, 2019, 7:09:51 AM12/15/19
to
Hi,

Trying to get mtime of this 'Vim.' and ending fails.
Even if I replace dot by backslash dot it fails.

Thank you in advance.

The ruby code used:

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
Reply all
Reply to author
Forward
0 new messages