Browse Source

File.exists? must die

Brent Cook 3 years ago
parent
commit
57ab974737
59 changed files with 101 additions and 101 deletions
  1. 1
    1
      data/exploits/capture/http/forms/grabforms.rb
  2. 1
    1
      lib/anemone/storage/pstore.rb
  3. 1
    1
      lib/msf/base/sessions/scriptable.rb
  4. 1
    1
      lib/msf/base/simple/framework.rb
  5. 9
    9
      lib/msf/core/db_manager/import/metasploit_framework/zip.rb
  6. 1
    1
      lib/msf/core/db_manager/module_cache.rb
  7. 2
    2
      lib/msf/core/db_manager/report.rb
  8. 1
    1
      lib/msf/core/encoder.rb
  9. 2
    2
      lib/msf/core/exploit/capture.rb
  10. 4
    4
      lib/msf/core/exploit/java.rb
  11. 1
    1
      lib/msf/core/opt_address_range.rb
  12. 1
    1
      lib/msf/core/opt_path.rb
  13. 4
    4
      lib/msf/core/post/file.rb
  14. 1
    1
      lib/msf/core/rpc/v10/rpc_plugin.rb
  15. 4
    4
      lib/msf/ui/console/command_dispatcher/core.rb
  16. 3
    3
      lib/msf/ui/console/command_dispatcher/db.rb
  17. 4
    4
      lib/msf/ui/console/driver.rb
  18. 1
    1
      lib/msf/util/document_generator.rb
  19. 2
    2
      lib/msf/util/exe.rb
  20. 3
    3
      lib/rex/compat.rb
  21. 1
    1
      lib/rex/exploitation/ropdb.rb
  22. 1
    1
      lib/rex/file.rb
  23. 1
    1
      lib/rex/post/meterpreter/client.rb
  24. 2
    2
      lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb
  25. 1
    1
      lib/rex/socket/comm/local.rb
  26. 1
    1
      lib/rex/ui/text/shell.rb
  27. 2
    2
      modules/auxiliary/fuzzers/ftp/client_ftp.rb
  28. 1
    1
      modules/auxiliary/scanner/http/nginx_source_disclosure.rb
  29. 3
    3
      modules/auxiliary/server/ftp.rb
  30. 1
    1
      modules/auxiliary/spoof/replay/pcap_replay.rb
  31. 1
    1
      modules/post/cisco/gather/enum_cisco.rb
  32. 1
    1
      modules/post/linux/gather/gnome_commander_creds.rb
  33. 1
    1
      modules/post/multi/gather/dns_bruteforce.rb
  34. 1
    1
      modules/post/multi/gather/multi_command.rb
  35. 1
    1
      modules/post/multi/gather/run_console_rc_file.rb
  36. 1
    1
      modules/post/multi/manage/multi_post.rb
  37. 1
    1
      modules/post/windows/gather/wmic_command.rb
  38. 1
    1
      modules/post/windows/manage/ie_proxypac.rb
  39. 3
    3
      msfupdate
  40. 1
    1
      plugins/sounds.rb
  41. 1
    1
      scripts/meterpreter/file_collector.rb
  42. 1
    1
      scripts/meterpreter/hostsedit.rb
  43. 1
    1
      scripts/meterpreter/multi_console_command.rb
  44. 1
    1
      scripts/meterpreter/multicommand.rb
  45. 1
    1
      scripts/meterpreter/multiscript.rb
  46. 1
    1
      scripts/meterpreter/netenum.rb
  47. 1
    1
      scripts/meterpreter/process_memdump.rb
  48. 1
    1
      scripts/meterpreter/schelevator.rb
  49. 2
    2
      scripts/meterpreter/schtasksabuse.rb
  50. 1
    1
      scripts/meterpreter/uploadexec.rb
  51. 1
    1
      scripts/meterpreter/virusscan_bypass.rb
  52. 5
    5
      scripts/meterpreter/win32-sshclient.rb
  53. 3
    3
      scripts/meterpreter/win32-sshserver.rb
  54. 2
    2
      scripts/meterpreter/winbf.rb
  55. 1
    1
      scripts/meterpreter/wmic.rb
  56. 1
    1
      tools/exploit/jsobfu.rb
  57. 1
    1
      tools/exploit/virustotal.rb
  58. 1
    1
      tools/password/md5_lookup.rb
  59. 2
    2
      tools/recon/makeiplist.rb

+ 1
- 1
data/exploits/capture/http/forms/grabforms.rb View File

@@ -28,7 +28,7 @@ File.readlines(sitelist).each do |site|
28 28
   next if site =~ /^#/
29 29
 
30 30
   out = File.join(output, site + ".txt")
31
-  File.unlink(out) if File.exists?(out)
31
+  File.unlink(out) if File.exist?(out)
32 32
 
33 33
   fd  = File.open(out, "a")
34 34
 

+ 1
- 1
lib/anemone/storage/pstore.rb View File

@@ -9,7 +9,7 @@ module Anemone
9 9
       def_delegators :@keys, :has_key?, :keys, :size
10 10
 
11 11
       def initialize(file)
12
-        File.delete(file) if File.exists?(file)
12
+        File.delete(file) if File.exist?(file)
13 13
         @store = ::PStore.new(file)
14 14
         @keys = {}
15 15
       end

+ 1
- 1
lib/msf/base/sessions/scriptable.rb View File

@@ -27,7 +27,7 @@ module Scriptable
27 27
 
28 28
       # Scan all of the path combinations
29 29
       check_paths.each { |path|
30
-        if ::File.exists?(path)
30
+        if ::File.exist?(path)
31 31
           full_path = path
32 32
           break
33 33
         end

+ 1
- 1
lib/msf/base/simple/framework.rb View File

@@ -30,7 +30,7 @@ module Framework
30 30
     def load(path, opts = {})
31 31
       def_path = Msf::Config.plugin_directory + File::SEPARATOR + path
32 32
 
33
-      if (File.exists?(def_path) or File.exists?(def_path + ".rb"))
33
+      if (File.exist?(def_path) or File.exist?(def_path + ".rb"))
34 34
         super(def_path, opts)
35 35
       else
36 36
         super

+ 9
- 9
lib/msf/core/db_manager/import/metasploit_framework/zip.rb View File

@@ -65,10 +65,10 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
65 65
 
66 66
       # Only report loot if we actually have it.
67 67
       # TODO: Copypasta. Separate this out.
68
-      if ::File.exists? loot_info[:orig_path]
68
+      if ::File.exist? loot_info[:orig_path]
69 69
         loot_dir = ::File.join(basedir,"loot")
70 70
         loot_file = ::File.split(loot_info[:orig_path]).last
71
-        if ::File.exists? loot_dir
71
+        if ::File.exist? loot_dir
72 72
           unless (::File.directory?(loot_dir) && ::File.writable?(loot_dir))
73 73
             raise Msf::DBImportError.new("Could not move files to #{loot_dir}")
74 74
           end
@@ -77,7 +77,7 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
77 77
         end
78 78
         new_loot = ::File.join(loot_dir,loot_file)
79 79
         loot_info[:path] = new_loot
80
-        if ::File.exists?(new_loot)
80
+        if ::File.exist?(new_loot)
81 81
           ::File.unlink new_loot # Delete it, and don't report it.
82 82
         else
83 83
           report_loot(loot_info) # It's new, so report it.
@@ -115,10 +115,10 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
115 115
 
116 116
       # Only report a task if we actually have it.
117 117
       # TODO: Copypasta. Separate this out.
118
-      if ::File.exists? task_info[:orig_path]
118
+      if ::File.exist? task_info[:orig_path]
119 119
         tasks_dir = ::File.join(basedir,"tasks")
120 120
         task_file = ::File.split(task_info[:orig_path]).last
121
-        if ::File.exists? tasks_dir
121
+        if ::File.exist? tasks_dir
122 122
           unless (::File.directory?(tasks_dir) && ::File.writable?(tasks_dir))
123 123
             raise Msf::DBImportError.new("Could not move files to #{tasks_dir}")
124 124
           end
@@ -127,7 +127,7 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
127 127
         end
128 128
         new_task = ::File.join(tasks_dir,task_file)
129 129
         task_info[:path] = new_task
130
-        if ::File.exists?(new_task)
130
+        if ::File.exist?(new_task)
131 131
           ::File.unlink new_task # Delete it, and don't report it.
132 132
         else
133 133
           report_task(task_info) # It's new, so report it.
@@ -156,7 +156,7 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
156 156
     bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
157 157
 
158 158
     new_tmp = ::File.join(Dir::tmpdir,"msf","imp_#{Rex::Text::rand_text_alphanumeric(4)}",@import_filedata[:zip_basename])
159
-    if ::File.exists? new_tmp
159
+    if ::File.exist? new_tmp
160 160
       unless (::File.directory?(new_tmp) && ::File.writable?(new_tmp))
161 161
         raise Msf::DBImportError.new("Could not extract zip file to #{new_tmp}")
162 162
       end
@@ -172,7 +172,7 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
172 172
     # already exist
173 173
     @import_filedata[:zip_tmp_subdirs].each {|sub|
174 174
       tmp_subdirs = ::File.join(@import_filedata[:zip_tmp],sub)
175
-      if File.exists? tmp_subdirs
175
+      if File.exist? tmp_subdirs
176 176
         unless (::File.directory?(tmp_subdirs) && File.writable?(tmp_subdirs))
177 177
           # if it exists but we can't write to it, give up
178 178
           raise Msf::DBImportError.new("Could not extract zip file to #{tmp_subdirs}")
@@ -198,7 +198,7 @@ module Msf::DBManager::Import::MetasploitFramework::Zip
198 198
     Dir.entries(@import_filedata[:zip_tmp]).each do |entry|
199 199
       if entry =~ /^.*#{Regexp.quote(Metasploit::Credential::Exporter::Core::CREDS_DUMP_FILE_IDENTIFIER)}.*/
200 200
         manifest_file_path = File.join(@import_filedata[:zip_tmp], entry, Metasploit::Credential::Importer::Zip::MANIFEST_FILE_NAME)
201
-        if File.exists? manifest_file_path
201
+        if File.exist? manifest_file_path
202 202
           import_msf_cred_dump(manifest_file_path, wspace)
203 203
         end
204 204
       end

+ 1
- 1
lib/msf/core/db_manager/module_cache.rb View File

@@ -329,7 +329,7 @@ module Msf::DBManager::ModuleCache
329 329
           next
330 330
         end
331 331
 
332
-        unless md.file and ::File.exists?(md.file)
332
+        unless md.file and ::File.exist?(md.file)
333 333
           refresh << md
334 334
           next
335 335
         end

+ 2
- 2
lib/msf/core/db_manager/report.rb View File

@@ -23,7 +23,7 @@ module Msf::DBManager::Report
23 23
     created = opts.delete(:created_at)
24 24
     updated = opts.delete(:updated_at)
25 25
 
26
-    unless File.exists? tmp_path
26
+    unless File.exist? tmp_path
27 27
       raise Msf::DBImportError 'Report artifact file to be imported does not exist.'
28 28
     end
29 29
 
@@ -31,7 +31,7 @@ module Msf::DBManager::Report
31 31
       raise Msf::DBImportError "Could not move report artifact file to #{artifacts_dir}."
32 32
     end
33 33
 
34
-    if File.exists? new_path
34
+    if File.exist? new_path
35 35
       unique_basename = "#{(Time.now.to_f*1000).to_i}_#{artifact_name}"
36 36
       new_path = File.join(artifacts_dir, unique_basename)
37 37
     end

+ 1
- 1
lib/msf/core/encoder.rb View File

@@ -537,7 +537,7 @@ protected
537 537
   #
538 538
   def find_context_key(buf, badchars, state)
539 539
     # Make sure our context information file is sane
540
-    if !File.exists?(datastore['ContextInformationFile'])
540
+    if !File.exist?(datastore['ContextInformationFile'])
541 541
       raise NoKeyError, "A context information file must specified when using context encoding", caller
542 542
     end
543 543
 

+ 2
- 2
lib/msf/core/exploit/capture.rb View File

@@ -110,7 +110,7 @@ module Msf
110 110
         cap = datastore['PCAPFILE'] || ''
111 111
 
112 112
         if (not cap.empty?)
113
-          if (not File.exists?(cap))
113
+          if (not File.exist?(cap))
114 114
             raise RuntimeError, "The PCAP file #{cap} could not be found"
115 115
           end
116 116
           self.capture = ::Pcap.open_offline(cap)
@@ -216,7 +216,7 @@ module Msf
216 216
           raise RuntimeError, "Could not access the capture process (remember to open_pcap first!)"
217 217
         end
218 218
 
219
-        if (not File.exists?(pcap_file))
219
+        if (not File.exist?(pcap_file))
220 220
           raise RuntimeError, "The PCAP file #{pcap_file} could not be found"
221 221
         end
222 222
 

+ 4
- 4
lib/msf/core/exploit/java.rb View File

@@ -47,7 +47,7 @@ module Exploit::Java
47 47
     end
48 48
 
49 49
     toolsjar = File.join(ENV['JAVA_HOME'], "lib", "tools.jar")
50
-    if (not File.exists? toolsjar)
50
+    if (not File.exist? toolsjar)
51 51
       raise RuntimeError, 'JAVA_HOME does not point to a valid JDK installation.'
52 52
     end
53 53
 
@@ -69,7 +69,7 @@ module Exploit::Java
69 69
   def save_to_file(classnames, codez, location)
70 70
     path = File.join( Msf::Config.install_root, "external", "source", location )
71 71
 
72
-    if not File.exists? path
72
+    if not File.exist? path
73 73
       Dir.mkdir(path)
74 74
     end
75 75
 
@@ -96,7 +96,7 @@ module Exploit::Java
96 96
     compile_options = [] if compile_options.nil?
97 97
 
98 98
     # Create the directory if it doesn't exist
99
-    Dir.mkdir(datastore['JavaCache']) if !File.exists? datastore['JavaCache']
99
+    Dir.mkdir(datastore['JavaCache']) if !File.exist? datastore['JavaCache']
100 100
 
101 101
     # For compatibility, some exploits need to have the target and source version
102 102
     # set to a previous JRE version.
@@ -157,7 +157,7 @@ module Exploit::Java
157 157
 
158 158
     # Check if the keystore exists from previous run.  If it does, delete it.
159 159
     msf_keystore	= File.join(datastore['JavaCache'], msf_keystore)
160
-    File.delete msf_keystore if File.exists? msf_keystore
160
+    File.delete msf_keystore if File.exist? msf_keystore
161 161
 
162 162
     # Rjb pukes on a CN with a comma in it so bad that it crashes to shell
163 163
     # and turns input echoing off.  Simple fix for this ugly bug is

+ 1
- 1
lib/msf/core/opt_address_range.rb View File

@@ -20,7 +20,7 @@ class OptAddressRange < OptBase
20 20
     return nil unless value.kind_of?(String)
21 21
     if (value =~ /^file:(.*)/)
22 22
       path = $1
23
-      return false if not File.exists?(path) or File.directory?(path)
23
+      return false if not File.exist?(path) or File.directory?(path)
24 24
       return File.readlines(path).map{ |s| s.strip}.join(" ")
25 25
     elsif (value =~ /^rand:(.*)/)
26 26
       count = $1.to_i

+ 1
- 1
lib/msf/core/opt_path.rb View File

@@ -23,7 +23,7 @@ class OptPath < OptBase
23 23
       if value =~ /^memory:\s*([0-9]+)/i
24 24
         return false unless check_memory_location($1)
25 25
       else
26
-        unless File.exists?(value)
26
+        unless File.exist?(value)
27 27
           return false
28 28
         end
29 29
       end

+ 4
- 4
lib/msf/core/post/file.rb View File

@@ -143,7 +143,7 @@ module Msf::Post::File
143 143
   # @param data [String]
144 144
   # @return [void]
145 145
   def file_local_write(local_file_name, data)
146
-    unless ::File.exists?(local_file_name)
146
+    unless ::File.exist?(local_file_name)
147 147
       ::FileUtils.touch(local_file_name)
148 148
     end
149 149
 
@@ -160,7 +160,7 @@ module Msf::Post::File
160 160
   # @param local_file_name [String] Local file name
161 161
   # @return [String] Hex digest of file contents
162 162
   def file_local_digestmd5(local_file_name)
163
-    if ::File.exists?(local_file_name)
163
+    if ::File.exist?(local_file_name)
164 164
       require 'digest/md5'
165 165
       chksum = nil
166 166
       chksum = Digest::MD5.hexdigest(::File.open(local_file_name, "rb") { |f| f.read})
@@ -191,7 +191,7 @@ module Msf::Post::File
191 191
   # @param local_file_name [String] Local file name
192 192
   # @return [String] Hex digest of file contents
193 193
   def file_local_digestsha1(local_file_name)
194
-    if ::File.exists?(local_file_name)
194
+    if ::File.exist?(local_file_name)
195 195
       require 'digest/sha1'
196 196
       chksum = nil
197 197
       chksum = Digest::SHA1.hexdigest(::File.open(local_file_name, "rb") { |f| f.read})
@@ -222,7 +222,7 @@ module Msf::Post::File
222 222
   # @param local_file_name [String] Local file name
223 223
   # @return [String] Hex digest of file contents
224 224
   def file_local_digestsha2(local_file_name)
225
-    if ::File.exists?(local_file_name)
225
+    if ::File.exist?(local_file_name)
226 226
       require 'digest/sha2'
227 227
       chksum = nil
228 228
       chksum = Digest::SHA256.hexdigest(::File.open(local_file_name, "rb") { |f| f.read})

+ 1
- 1
lib/msf/core/rpc/v10/rpc_plugin.rb View File

@@ -30,7 +30,7 @@ class RPC_Plugin < RPC_Base
30 30
 
31 31
       # If the plugin isn't in the user direcotry (~/.msf3/plugins/), use the base
32 32
       path = Msf::Config.user_plugin_directory + File::SEPARATOR + plugin_file_name
33
-      if not File.exists?( path  + ".rb" )
33
+      if not File.exist?( path  + ".rb" )
34 34
         # If the following "path" doesn't exist it will be caught when we attempt to load
35 35
         path = Msf::Config.plugin_directory + File::SEPARATOR + plugin_file_name
36 36
       end

+ 4
- 4
lib/msf/ui/console/command_dispatcher/core.rb View File

@@ -249,7 +249,7 @@ class Core
249 249
 
250 250
     args.each do |res|
251 251
       good_res = nil
252
-      if ::File.exists?(res)
252
+      if ::File.exist?(res)
253 253
         good_res = res
254 254
       elsif
255 255
         # let's check to see if it's in the scripts/resource dir (like when tab completed)
@@ -258,7 +258,7 @@ class Core
258 258
           ::Msf::Config.user_script_directory + ::File::SEPARATOR + "resource"
259 259
         ].each do |dir|
260 260
           res_path = dir + ::File::SEPARATOR + res
261
-          if ::File.exists?(res_path)
261
+          if ::File.exist?(res_path)
262 262
             good_res = res_path
263 263
             break
264 264
           end
@@ -1254,7 +1254,7 @@ class Core
1254 1254
 
1255 1255
       # If the plugin isn't in the user directory (~/.msf3/plugins/), use the base
1256 1256
       path = Msf::Config.user_plugin_directory + File::SEPARATOR + plugin_file_name
1257
-      if not File.exists?( path  + ".rb" )
1257
+      if not File.exist?( path  + ".rb" )
1258 1258
         # If the following "path" doesn't exist it will be caught when we attempt to load
1259 1259
         path = Msf::Config.plugin_directory + File::SEPARATOR + plugin_file_name
1260 1260
       end
@@ -3291,7 +3291,7 @@ class Core
3291 3291
 
3292 3292
   # Determines if this is an apt-based install
3293 3293
   def is_apt
3294
-    File.exists?(File.expand_path(File.join(Msf::Config.install_root, '.apt')))
3294
+    File.exist?(File.expand_path(File.join(Msf::Config.install_root, '.apt')))
3295 3295
   end
3296 3296
 
3297 3297
   # Determines if we're a Metasploit Pro/Community/Express

+ 3
- 3
lib/msf/ui/console/command_dispatcher/db.rb View File

@@ -1469,7 +1469,7 @@ class Db
1469 1469
             print_error("Can't make loot with no filename")
1470 1470
             return
1471 1471
           end
1472
-          if (!File.exists?(filename) or !File.readable?(filename))
1472
+          if (!File.exist?(filename) or !File.readable?(filename))
1473 1473
             print_error("Can't read file")
1474 1474
             return
1475 1475
           end
@@ -1979,13 +1979,13 @@ class Db
1979 1979
       return
1980 1980
     end
1981 1981
     if (args[0] == "-y")
1982
-      if (args[1] and not ::File.exists? ::File.expand_path(args[1]))
1982
+      if (args[1] and not ::File.exist? ::File.expand_path(args[1]))
1983 1983
         print_error("File not found")
1984 1984
         return
1985 1985
       end
1986 1986
       file = args[1] || ::File.join(Msf::Config.get_config_root, "database.yml")
1987 1987
       file = ::File.expand_path(file)
1988
-      if (::File.exists? file)
1988
+      if (::File.exist? file)
1989 1989
         db = YAML.load(::File.read(file))['production']
1990 1990
         framework.db.connect(db)
1991 1991
 

+ 4
- 4
lib/msf/ui/console/driver.rb View File

@@ -220,7 +220,7 @@ class Driver < Msf::Ui::Driver
220 220
     if opts['Resource'].blank?
221 221
       # None given, load the default
222 222
       default_resource = ::File.join(Msf::Config.config_directory, 'msfconsole.rc')
223
-      load_resource(default_resource) if ::File.exists?(default_resource)
223
+      load_resource(default_resource) if ::File.exist?(default_resource)
224 224
     else
225 225
       opts['Resource'].each { |r|
226 226
         load_resource(r)
@@ -279,7 +279,7 @@ class Driver < Msf::Ui::Driver
279 279
 
280 280
     fname = ::File.join(@junit_output_path, "#{bname}.xml")
281 281
     cnt   = 0
282
-    while ::File.exists?( fname )
282
+    while ::File.exist?( fname )
283 283
       cnt  += 1
284 284
       fname = ::File.join(@junit_output_path, "#{bname}_#{cnt}.xml")
285 285
     end
@@ -314,7 +314,7 @@ class Driver < Msf::Ui::Driver
314 314
     # Generate the output path, allow multiple test with the same name
315 315
     fname = ::File.join(@junit_output_path, "#{bname}.xml")
316 316
     cnt   = 0
317
-    while ::File.exists?( fname )
317
+    while ::File.exist?( fname )
318 318
       cnt  += 1
319 319
       fname = ::File.join(@junit_output_path, "#{bname}_#{cnt}.xml")
320 320
     end
@@ -416,7 +416,7 @@ class Driver < Msf::Ui::Driver
416 416
     if path == '-'
417 417
       resource_file = $stdin.read
418 418
       path = 'stdin'
419
-    elsif ::File.exists?(path)
419
+    elsif ::File.exist?(path)
420 420
       resource_file = ::File.read(path)
421 421
     else
422 422
       print_error("Cannot find resource script: #{path}")

+ 1
- 1
lib/msf/util/document_generator.rb View File

@@ -37,7 +37,7 @@ module Msf
37 37
         kb_path = File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md")
38 38
         kb = ''
39 39
 
40
-        if File.exists?(kb_path)
40
+        if File.exist?(kb_path)
41 41
           File.open(kb_path, 'rb') { |f| kb = f.read }
42 42
         end
43 43
 

+ 2
- 2
lib/msf/util/exe.rb View File

@@ -2253,9 +2253,9 @@ require 'msf/core/exe/segment_appender'
2253 2253
     path = ::File.expand_path(::File.join(
2254 2254
       ::File.dirname(__FILE__),"..", "..", "..", "data", "eicar.com")
2255 2255
     )
2256
-    return true unless ::File.exists?(path)
2256
+    return true unless ::File.exist?(path)
2257 2257
     ret = false
2258
-    if ::File.exists?(path)
2258
+    if ::File.exist?(path)
2259 2259
       begin
2260 2260
         data = ::File.read(path)
2261 2261
         unless Digest::SHA1.hexdigest(data) == "3395856ce81f2b7382dee72602f798b642f14140"

+ 3
- 3
lib/rex/compat.rb View File

@@ -138,7 +138,7 @@ def self.open_browser(url='http://google.com/')
138 138
       ['xdg-open', 'sensible-browser', 'firefox', 'firefox-bin', 'opera', 'konqueror', 'chromium-browser'].each do |browser|
139 139
         ENV['PATH'].split(':').each do |path|
140 140
           # Does the browser exists?
141
-          if File.exists?("#{path}/#{browser}")
141
+          if File.exist?("#{path}/#{browser}")
142 142
             system("#{browser} #{url} &")
143 143
             return
144 144
           end
@@ -165,7 +165,7 @@ def self.open_webrtc_browser(url='http://google.com/')
165 165
       paths << "#{app_data}\\Google\\Chrome\\Application\\chrome.exe"
166 166
 
167 167
       paths.each do |path|
168
-        if File.exists?(path)
168
+        if File.exist?(path)
169 169
           args = (path =~ /chrome\.exe/) ? "--allow-file-access-from-files" : ""
170 170
           system("\"#{path}\" #{args} \"#{url}\"")
171 171
           return true
@@ -187,7 +187,7 @@ def self.open_webrtc_browser(url='http://google.com/')
187 187
       ['google-chrome', 'chrome', 'chromium', 'firefox' , 'firefox', 'opera'].each do |browser|
188 188
         ENV['PATH'].split(':').each do |path|
189 189
           browser_path = "#{path}/#{browser}"
190
-          if File.exists?(browser_path)
190
+          if File.exist?(browser_path)
191 191
             args = (browser_path =~ /Chrome/) ? "--allow-file-access-from-files" : ""
192 192
             system("#{browser_path} #{args} #{url} &")
193 193
             return true

+ 1
- 1
lib/rex/exploitation/ropdb.rb View File

@@ -24,7 +24,7 @@ class RopDb
24 24
   # Returns true if a ROP chain is available, otherwise false
25 25
   #
26 26
   def has_rop?(rop_name)
27
-    File.exists?(File.join(@base_path, "#{rop_name}.xml"))
27
+    File.exist?(File.join(@base_path, "#{rop_name}.xml"))
28 28
   end
29 29
 
30 30
   #

+ 1
- 1
lib/rex/file.rb View File

@@ -82,7 +82,7 @@ module FileUtils
82 82
   def self.find_full_path(file_name)
83 83
 
84 84
     # Check for the absolute fast first
85
-    if (file_name[0,1] == "/" and ::File.exists?(file_name) and ::File::Stat.new(file_name))
85
+    if (file_name[0,1] == "/" and ::File.exist?(file_name) and ::File::Stat.new(file_name))
86 86
       return file_name
87 87
     end
88 88
 

+ 1
- 1
lib/rex/post/meterpreter/client.rb View File

@@ -132,7 +132,7 @@ class Client
132 132
 
133 133
     # The SSL certificate is being passed down as a file path
134 134
     if opts[:ssl_cert]
135
-      if ! ::File.exists? opts[:ssl_cert]
135
+      if ! ::File.exist? opts[:ssl_cert]
136 136
         elog("SSL certificate at #{opts[:ssl_cert]} does not exist and will be ignored")
137 137
       else
138 138
         # Load the certificate the same way that SslTcpServer does it

+ 2
- 2
lib/rex/post/meterpreter/extensions/stdapi/fs/file.rb View File

@@ -184,7 +184,7 @@ class File < Rex::Post::Meterpreter::Extensions::Stdapi::Fs::IO
184 184
   #
185 185
   # Returns true if the remote file +name+ exists, false otherwise
186 186
   #
187
-  def File.exists?(name)
187
+  def File.exist?(name)
188 188
     r = client.fs.filestat.new(name) rescue nil
189 189
     r ? true : false
190 190
   end
@@ -302,7 +302,7 @@ class File < Rex::Post::Meterpreter::Extensions::Stdapi::Fs::IO
302 302
 
303 303
     # Check for changes
304 304
     src_stat = client.fs.filestat.new(src_file)
305
-    if ::File.exists?(dest_file)
305
+    if ::File.exist?(dest_file)
306 306
       dst_stat = ::File.stat(dest_file)
307 307
       if src_stat.size == dst_stat.size && src_stat.mtime == dst_stat.mtime
308 308
         return 'skipped'

+ 1
- 1
lib/rex/socket/comm/local.rb View File

@@ -240,7 +240,7 @@ class Rex::Socket::Comm::Local
240 240
         if @@ip6_lla_scopes.length == 0 and retry_scopes
241 241
 
242 242
           # Linux specific interface lookup code
243
-          if ::File.exists?( "/proc/self/net/igmp6" )
243
+          if ::File.exist?( "/proc/self/net/igmp6" )
244 244
             ::File.open("/proc/self/net/igmp6") do |fd|
245 245
               fd.each_line do |line|
246 246
                 line = line.strip

+ 1
- 1
lib/rex/ui/text/shell.rb View File

@@ -57,7 +57,7 @@ module Shell
57 57
   def init_tab_complete
58 58
     if (self.input and self.input.supports_readline)
59 59
       self.input = Input::Readline.new(lambda { |str| tab_complete(str) })
60
-      if Readline::HISTORY.length == 0 and histfile and File.exists?(histfile)
60
+      if Readline::HISTORY.length == 0 and histfile and File.exist?(histfile)
61 61
         File.readlines(histfile).each { |e|
62 62
           Readline::HISTORY << e.chomp
63 63
         }

+ 2
- 2
modules/auxiliary/fuzzers/ftp/client_ftp.rb View File

@@ -325,11 +325,11 @@ class MetasploitModule < Msf::Auxiliary
325 325
       return
326 326
 
327 327
     when 'RNFR'
328
-      send_response(c,arg,"RNRF",350," File exists")
328
+      send_response(c,arg,"RNRF",350," File.exist")
329 329
       return
330 330
 
331 331
     when 'RNTO'
332
-      send_response(c,arg,"RNTO",350," File exists")
332
+      send_response(c,arg,"RNTO",350," File.exist")
333 333
       return
334 334
     else
335 335
       send_response(c,arg,cmd.upcase,200," Command not understood")

+ 1
- 1
modules/auxiliary/scanner/http/nginx_source_disclosure.rb View File

@@ -83,7 +83,7 @@ class MetasploitModule < Msf::Auxiliary
83 83
           save_source.puts(res.body.to_s)
84 84
           save_source.close
85 85
 
86
-          print_status("#{full_uri} - nginx - File successfully saved: #{path_save}#{uri}") if (File.exists?("#{path_save}#{uri}"))
86
+          print_status("#{full_uri} - nginx - File successfully saved: #{path_save}#{uri}") if (File.exist?("#{path_save}#{uri}"))
87 87
 
88 88
         else
89 89
           print_error("http://#{vhost}:#{rport} - nginx - Unrecognized #{res.code} response")

+ 3
- 3
modules/auxiliary/server/ftp.rb View File

@@ -74,7 +74,7 @@ class MetasploitModule < Msf::Auxiliary
74 74
     end
75 75
 
76 76
     path = ::File.join(datastore['FTPROOT'], Rex::FileUtils.clean_path(arg))
77
-    if(not ::File.exists?(path))
77
+    if(not ::File.exist?(path))
78 78
       c.put "550 File does not exist\r\n"
79 79
       return
80 80
     end
@@ -134,7 +134,7 @@ class MetasploitModule < Msf::Auxiliary
134 134
     end
135 135
 
136 136
     path = ::File.join(datastore['FTPROOT'], Rex::FileUtils.clean_path(arg))
137
-    if(not ::File.exists?(path))
137
+    if(not ::File.exist?(path))
138 138
       c.put "550 File does not exist\r\n"
139 139
       return
140 140
     end
@@ -160,7 +160,7 @@ class MetasploitModule < Msf::Auxiliary
160 160
     end
161 161
 
162 162
     npath = ::File.expand_path(::File.join(datastore['FTPROOT'], bpath))
163
-    if not (::File.exists?(npath) and ::File.directory?(npath))
163
+    if not (::File.exist?(npath) and ::File.directory?(npath))
164 164
       c.put "550 Directory does not exist\r\n"
165 165
       return
166 166
     end

+ 1
- 1
modules/auxiliary/spoof/replay/pcap_replay.rb View File

@@ -40,7 +40,7 @@ class MetasploitModule < Msf::Auxiliary
40 40
     filename = datastore['FILENAME']
41 41
     verbose = datastore['VERBOSE']
42 42
     count = 0
43
-    unless File.exists? filename and File.file? filename
43
+    unless File.exist? filename and File.file? filename
44 44
       print_error("Pcap File does not exist")
45 45
       return
46 46
     end

+ 1
- 1
modules/post/cisco/gather/enum_cisco.rb View File

@@ -116,7 +116,7 @@ class MetasploitModule < Msf::Post
116 116
       end
117 117
     else
118 118
       if pass_file
119
-        if not ::File.exists?(pass_file)
119
+        if not ::File.exist?(pass_file)
120 120
           print_error("Wordlist File #{pass_file} does not exists!")
121 121
           return
122 122
         end

+ 1
- 1
modules/post/linux/gather/gnome_commander_creds.rb View File

@@ -43,7 +43,7 @@ class MetasploitModule < Msf::Post
43 43
       # gnome-commander connections file
44 44
       connections_file = "#{dir}/.gnome-commander/connections"
45 45
       if file?(connections_file)
46
-        #File exists
46
+        #File.exist
47 47
         begin
48 48
           str_file=read_file(connections_file)
49 49
           print_good("File found: #{connections_file}")

+ 1
- 1
modules/post/multi/gather/dns_bruteforce.rb View File

@@ -51,7 +51,7 @@ class MetasploitModule < Msf::Post
51 51
     end
52 52
 
53 53
     name_list = []
54
-    if ::File.exists?(hostlst)
54
+    if ::File.exist?(hostlst)
55 55
       ::File.open(hostlst).each do |n|
56 56
         name_list << n
57 57
       end

+ 1
- 1
modules/post/multi/gather/multi_command.rb View File

@@ -28,7 +28,7 @@ class MetasploitModule < Msf::Post
28 28
   # Run Method for when run command is issued
29 29
   def run
30 30
     print_status("Running module against #{sysinfo['Computer']}")
31
-    if not ::File.exists?(datastore['RESOURCE'])
31
+    if not ::File.exist?(datastore['RESOURCE'])
32 32
       raise "Resource File does not exists!"
33 33
     else
34 34
       ::File.open(datastore['RESOURCE'], "rb").each_line do |cmd|

+ 1
- 1
modules/post/multi/gather/run_console_rc_file.rb View File

@@ -32,7 +32,7 @@ class MetasploitModule < Msf::Post
32 32
   # Run Method for when run command is issued
33 33
   def run
34 34
     print_status("Running module against #{sysinfo['Computer']}")
35
-    if not ::File.exists?(datastore['RESOURCE'])
35
+    if not ::File.exist?(datastore['RESOURCE'])
36 36
       raise "Resource File does not exists!"
37 37
     else
38 38
       ::File.open(datastore['RESOURCE'], "rb").each_line do |cmd|

+ 1
- 1
modules/post/multi/manage/multi_post.rb View File

@@ -37,7 +37,7 @@ class MetasploitModule < Msf::Post
37 37
     print_status("Running module against #{sysinfo['Computer']}") if not sysinfo.nil?
38 38
     macro = datastore['MACRO']
39 39
     entries = []
40
-    if not ::File.exists?(macro)
40
+    if not ::File.exist?(macro)
41 41
       print_error "Resource File does not exists!"
42 42
       return
43 43
     else

+ 1
- 1
modules/post/windows/gather/wmic_command.rb View File

@@ -34,7 +34,7 @@ class MetasploitModule < Msf::Post
34 34
     tmpout = ""
35 35
     print_status("Running module against #{sysinfo['Computer']}")
36 36
     if datastore['RESOURCE']
37
-      if ::File.exists?(datastore['RESOURCE'])
37
+      if ::File.exist?(datastore['RESOURCE'])
38 38
 
39 39
         ::File.open(datastore['RESOURCE']).each_line do |cmd|
40 40
 

+ 1
- 1
modules/post/windows/manage/ie_proxypac.rb View File

@@ -90,7 +90,7 @@ class MetasploitModule < Msf::Post
90 90
     pac_file = session.sys.config.getenv("APPDATA") << "\\" << Rex::Text.rand_text_alpha((rand(8)+6)) << ".pac"
91 91
     conf_pac = ""
92 92
 
93
-    if ::File.exists?(local_pac)
93
+    if ::File.exist?(local_pac)
94 94
       conf_pac << ::File.open(local_pac, "rb").read
95 95
     else
96 96
       print_error("Local PAC file not found.")

+ 3
- 3
msfupdate View File

@@ -105,12 +105,12 @@ class Msfupdate
105 105
   end
106 106
 
107 107
   def apt?
108
-    File.exists?(File.expand_path(File.join(@msfbase_dir, '.apt')))
108
+    File.exist?(File.expand_path(File.join(@msfbase_dir, '.apt')))
109 109
   end
110 110
 
111 111
   # Are you an installer, or did you get here via a source checkout?
112 112
   def binary_install?
113
-    File.exists?(File.expand_path(File.join(@msfbase_dir, "..", "engine", "update.rb"))) && !apt?
113
+    File.exist?(File.expand_path(File.join(@msfbase_dir, "..", "engine", "update.rb"))) && !apt?
114 114
   end
115 115
 
116 116
   def git?
@@ -201,7 +201,7 @@ class Msfupdate
201 201
   def update_binary_install!
202 202
     update_script = File.expand_path(File.join(@msfbase_dir, "..", "engine", "update.rb"))
203 203
     product_key =   File.expand_path(File.join(@msfbase_dir, "..", "engine", "license", "product.key"))
204
-    if File.exists? product_key
204
+    if File.exist? product_key
205 205
       if File.readable? product_key
206 206
         if (@offline_file)
207 207
           system("ruby", update_script, @offline_file)

+ 1
- 1
plugins/sounds.rb View File

@@ -52,7 +52,7 @@ class Plugin::EventSounds < Msf::Plugin
52 52
       while(true)
53 53
         while(event = self.queue.shift)
54 54
           path = ::File.join(self.base, self.theme, "#{event}.wav")
55
-          if(::File.exists?(path))
55
+          if(::File.exist?(path))
56 56
             Rex::Compat.play_sound(path)
57 57
           else
58 58
             print_status("Warning: sound file not found: #{path}")

+ 1
- 1
scripts/meterpreter/file_collector.rb View File

@@ -67,7 +67,7 @@ if client.platform =~ /win32|win64/
67 67
     end
68 68
     # Read log file and download those files found
69 69
     if input_file and logs
70
-      if ::File.exists?(input_file)
70
+      if ::File.exist?(input_file)
71 71
         print_status("Reading file #{input_file}")
72 72
         print_status("Downloading to #{logs}")
73 73
         ::File.open(input_file, "r").each_line do |line|

+ 1
- 1
scripts/meterpreter/hostsedit.rb View File

@@ -84,7 +84,7 @@ if client.platform =~ /win32|win64/
84 84
       cleardnscach(session)
85 85
     when "-l"
86 86
       checkuac(session)
87
-      if not ::File.exists?(val)
87
+      if not ::File.exist?(val)
88 88
         raise "File #{val} does not exists!"
89 89
       else
90 90
         backuphosts(session,hosts)

+ 1
- 1
scripts/meterpreter/multi_console_command.rb View File

@@ -58,7 +58,7 @@ end
58 58
     commands = val.split(",")
59 59
   when "-rc"
60 60
     script = val
61
-    if not ::File.exists?(script)
61
+    if not ::File.exist?(script)
62 62
       raise "Command List File does not exists!"
63 63
     else
64 64
       commands = []

+ 1
- 1
scripts/meterpreter/multicommand.rb View File

@@ -81,7 +81,7 @@ end
81 81
     commands = val.split(",")
82 82
   when "-rc"
83 83
     script = val
84
-    if not ::File.exists?(script)
84
+    if not ::File.exist?(script)
85 85
       raise "Command List File does not exists!"
86 86
     else
87 87
       ::File.open(script, "r").each_line do |line|

+ 1
- 1
scripts/meterpreter/multiscript.rb View File

@@ -57,7 +57,7 @@ end
57 57
     commands = val.gsub(/;/,"\n")
58 58
   when "-rc"
59 59
     script = val
60
-    if not ::File.exists?(script)
60
+    if not ::File.exist?(script)
61 61
       raise "Script List File does not exists!"
62 62
     else
63 63
       ::File.open(script, "rb").each_line do |line|

+ 1
- 1
scripts/meterpreter/netenum.rb View File

@@ -146,7 +146,7 @@ def frwdlp(session, hostlst, domain, dest)
146 146
   threads = []
147 147
   tmpout = []
148 148
   begin
149
-    if ::File.exists?(hostlst)
149
+    if ::File.exist?(hostlst)
150 150
       ::File.open(hostlst).each {|line|
151 151
         threads << ::Thread.new(line) { |h|
152 152
           #print_status("checking #{h.chomp}")

+ 1
- 1
scripts/meterpreter/process_memdump.rb View File

@@ -52,7 +52,7 @@ end
52 52
   when "-r"
53 53
     list = val
54 54
     resource = ""
55
-    if not ::File.exists?(list)
55
+    if not ::File.exist?(list)
56 56
       raise "Command List File does not exists!"
57 57
     else
58 58
       ::File.open(list, "r").each_line do |line|

+ 1
- 1
scripts/meterpreter/schelevator.rb View File

@@ -89,7 +89,7 @@ upload_fn = nil
89 89
 
90 90
   when "-u"
91 91
     upload_fn = val
92
-    if not ::File.exists?(upload_fn)
92
+    if not ::File.exist?(upload_fn)
93 93
       raise "Specified file to upload does not exist!"
94 94
     end
95 95
 

+ 2
- 2
scripts/meterpreter/schtasksabuse.rb View File

@@ -131,7 +131,7 @@ end
131 131
     delay = val.to_i
132 132
   when "-s"
133 133
     script = val
134
-    if not ::File.exists?(script)
134
+    if not ::File.exist?(script)
135 135
       raise "Command List File does not exists!"
136 136
     else
137 137
       ::File.open(script, "r").each_line do |line|
@@ -140,7 +140,7 @@ end
140 140
     end
141 141
   when "-l"
142 142
     list = val
143
-    if not ::File.exists?(list)
143
+    if not ::File.exist?(list)
144 144
       raise "Command List File does not exists!"
145 145
     else
146 146
       ::File.open(list, "r").each_line do |line|

+ 1
- 1
scripts/meterpreter/uploadexec.rb View File

@@ -25,7 +25,7 @@ def usage()
25 25
 end
26 26
 
27 27
 def upload(session,file,trgloc = "")
28
-  if not ::File.exists?(file)
28
+  if not ::File.exist?(file)
29 29
     raise "File to Upload does not exists!"
30 30
   else
31 31
     if trgloc == ""

+ 1
- 1
scripts/meterpreter/virusscan_bypass.rb View File

@@ -36,7 +36,7 @@ end
36 36
 @location = ""
37 37
 
38 38
 def upload(session,file,trgloc)
39
-  if not ::File.exists?(file)
39
+  if not ::File.exist?(file)
40 40
     raise "File to Upload does not exists!"
41 41
   else
42 42
     @location = session.sys.config.getenv('TEMP')

+ 5
- 5
scripts/meterpreter/win32-sshclient.rb View File

@@ -90,7 +90,7 @@ EOS
90 90
 #
91 91
 
92 92
 def upload(client,file,trgloc = nil)
93
-  if not ::File.exists?(file)
93
+  if not ::File.exist?(file)
94 94
     raise "File to Upload does not exists!"
95 95
   else
96 96
     if trgloc == nil
@@ -164,7 +164,7 @@ downloaded = nil
164 164
       usage
165 165
     end
166 166
     plink = val
167
-    if not ::File.exists?(plink)
167
+    if not ::File.exist?(plink)
168 168
       print_error("Plink.exe not found/accessible!")
169 169
       usage
170 170
     end
@@ -258,7 +258,7 @@ downloaded = nil
258 258
       usage
259 259
     end
260 260
     keyfile = val
261
-    if not ::File.exists?(keyfile)
261
+    if not ::File.exist?(keyfile)
262 262
       print_error("keyfile not found or not accessible!")
263 263
       usage
264 264
     end
@@ -269,7 +269,7 @@ downloaded = nil
269 269
       usage
270 270
     end
271 271
     cmdfile = val
272
-    if not ::File.exists?(cmdfile)
272
+    if not ::File.exist?(cmdfile)
273 273
       print_error("cmd-file not found/accessible!")
274 274
       usage
275 275
     end
@@ -320,7 +320,7 @@ end
320 320
 # Ask user before downloading
321 321
 #
322 322
 if not manual
323
-  if not ::File.exists?(plink)
323
+  if not ::File.exist?(plink)
324 324
     print_status("plink.exe could not be found. Downloading it now...")
325 325
     print_status(license)
326 326
     plinkexe = Net::HTTP.get URI.parse(plinkurl)

+ 3
- 3
scripts/meterpreter/win32-sshserver.rb View File

@@ -108,7 +108,7 @@ type = "auto"
108 108
       usage
109 109
     end
110 110
     extractfilename = val
111
-    if not ::File.exists?(extractfilename)
111
+    if not ::File.exist?(extractfilename)
112 112
       print_error("OpenSSH-SFX not found/accessible!")
113 113
       usage
114 114
     end
@@ -244,7 +244,7 @@ end
244 244
 #
245 245
 
246 246
 if manual == false
247
-  if not ::File.exists?(extractfilename)
247
+  if not ::File.exist?(extractfilename)
248 248
     print_status("openssh-extract.sfx could not be found. Downloading it now...")
249 249
     print_status(license)
250 250
     extractexe = Net::HTTP.get URI.parse(downloadurl)
@@ -262,7 +262,7 @@ if dirname == nil
262 262
   print_status("Creating directory #{dirname}.....")
263 263
   client.fs.dir.mkdir(dirname)
264 264
 else
265
-  if  !::File.exists?(dirname) && !::File.directory?(dirname)
265
+  if  !::File.exist?(dirname) && !::File.directory?(dirname)
266 266
     print_status("Creating directory #{dirname}.....")
267 267
     client.fs.dir.mkdir(dirname)
268 268
   end

+ 2
- 2
scripts/meterpreter/winbf.rb View File

@@ -77,7 +77,7 @@ def passbf(session,passlist,target,user,opt,logfile)
77 77
   a = []
78 78
   i = 0
79 79
   if opt == 1
80
-    if not ::File.exists?(user)
80
+    if not ::File.exist?(user)
81 81
       raise "Usernames List File does not exists!"
82 82
     else
83 83
       user = ::File.open(user, "r")
@@ -170,7 +170,7 @@ unsupported if client.platform !~ /win32|win64/i
170 170
   when "-p"
171 171
 
172 172
     passlist = val
173
-    if not ::File.exists?(passlist)
173
+    if not ::File.exist?(passlist)
174 174
       raise "Password File does not exists!"
175 175
     end
176 176
   when "-t"

+ 1
- 1
scripts/meterpreter/wmic.rb View File

@@ -103,7 +103,7 @@ end
103 103
   when "-s"
104 104
 
105 105
     script = val
106
-    if not ::File.exists?(script)
106
+    if not ::File.exist?(script)
107 107
       raise "Command List File does not exists!"
108 108
     else
109 109
       ::File.open(script, "r").each_line do |line|

+ 1
- 1
tools/exploit/jsobfu.rb View File

@@ -48,7 +48,7 @@ module Jsobfu
48 48
         raise OptionParser::MissingArgument, 'No options set, try -h for usage'
49 49
       elsif options[:iteration] && options[:iteration] !~ /^\d+$/
50 50
         raise OptionParser::InvalidOption, "#{options[:format]} is not a number"
51
-      elsif !::File.exists?(options[:input].to_s)
51
+      elsif !::File.exist?(options[:input].to_s)
52 52
         raise OptionParser::InvalidOption, "Cannot find: #{options[:input]}"
53 53
       end
54 54
 

+ 1
- 1
tools/exploit/virustotal.rb View File

@@ -316,7 +316,7 @@ class OptsConsole
316 316
         files = v.split.delete_if { |e| e.nil? }
317 317
         bad_files = []
318 318
         files.each do |f|
319
-          unless ::File.exists?(f)
319
+          unless ::File.exist?(f)
320 320
             bad_files << f
321 321
           end
322 322
         end

+ 1
- 1
tools/password/md5_lookup.rb View File

@@ -292,7 +292,7 @@ module Md5LookupUtility
292 292
 
293 293
         opt.on('-i', '--input <file>',
294 294
           'The file that contains all the MD5 hashes (one line per hash)') do |v|
295
-          if v && !::File.exists?(v)
295
+          if v && !::File.exist?(v)
296 296
             raise OptionParser::InvalidOption, "Invalid input file: #{v}"
297 297
           end
298 298
 

+ 2
- 2
tools/recon/makeiplist.rb View File

@@ -58,7 +58,7 @@ Usage: #{__FILE__} [options]|
58 58
         puts opts
59 59
         raise OptionParser::MissingArgument, "-i is a required option"
60 60
       end
61
-      unless ::File.exists?(options['input'])
61
+      unless ::File.exist?(options['input'])
62 62
         raise OptionParser::InvalidArgument, "Not found: #{options['input']}"
63 63
       end
64 64
     rescue OptionParser::InvalidOption
@@ -99,7 +99,7 @@ def load_files(in_f, out_f)
99 99
   handle_in = ::File.open(in_f, 'r')
100 100
 
101 101
   # Output file not found, assuming we should create one automatically
102
-  ::File.open(out_f, 'w') {} unless ::File.exists?(out_f)
102
+  ::File.open(out_f, 'w') {} unless ::File.exist?(out_f)
103 103
 
104 104
   handle_out = ::File.open(out_f, 'a')
105 105
 

Loading…
Cancel
Save