Ensure that the base directory exists before creating the file

This commit is contained in:
HD Moore
2015-05-21 00:40:49 -05:00
parent 4622fa60eb
commit eac1663fed
+2
View File
@@ -1,6 +1,7 @@
# -*- coding => binary -*-
require 'json'
require 'fileutils'
#
# This class provides a thread-friendly hash file store in JSON format
@@ -15,6 +16,7 @@ class JSONHashFile
@lock = Mutex.new
@hash = {}
@last = 0
::FileUtils.mkdir_p(::File.dirname(path))
synced_update
end