Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #7416

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

Newsgroups comp.lang.ruby
Date 2019-12-15 04:09 -0800
Message-ID <5c24f3a6-224b-4a5f-9af9-2b834545cb27@googlegroups.com> (permalink)
Subject ruby 2.6 : File.mtime fails when filename ends with dot char
From Ni Va <nivaemail@gmail.com>

Show all headers | View raw


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

Back to comp.lang.ruby | Previous | Next | Find similar


Thread

ruby 2.6 : File.mtime fails when filename ends with dot char Ni Va <nivaemail@gmail.com> - 2019-12-15 04:09 -0800

csiph-web