We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 67e7119 commit 3141d4eCopy full SHA for 3141d4e
lib/rex/json_hash_file.rb
@@ -16,7 +16,6 @@ def initialize(path)
16
@lock = Mutex.new
17
@hash = {}
18
@last = 0
19
- ::FileUtils.mkdir_p(::File.dirname(path))
20
end
21
22
def [](k)
@@ -52,6 +51,7 @@ def clear
52
51
# Save the file, but prevent thread & process contention
53
def synced_update(&block)
54
@lock.synchronize do
+ ::FileUtils.mkdir_p(::File.dirname(path))
55
::File.open(path, ::File::RDWR|::File::CREAT) do |fd|
56
fd.flock(::File::LOCK_EX)
57
@@ -80,7 +80,6 @@ def synced_update(&block)
80
81
82
83
-
84
def parse_data(data)
85
return {} if data.to_s.strip.length == 0
86
begin
0 commit comments