new(file, thread_safe = false)
public
To construct a PStore object, pass in the
file path where you would like the
data to be stored.
PStore objects are always reentrant. But if
thread_safe is set to true, then it will become thread-safe at the
cost of a minor performance hit.
Show source
def initialize(file, thread_safe = false)
dir = File::dirname(file)
unless File::directory? dir
raise PStore::Error, format("directory %s does not exist", dir)
end
if File::exist? file and not File::readable? file
raise PStore::Error, format("file %s not readable", file)
end
@filename = file
@abort = false
@ultra_safe = false
@thread_safe = thread_safe
@lock = Mutex.new
end