summaryrefslogtreecommitdiff
path: root/lib/pstore.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pstore.rb')
-rw-r--r--lib/pstore.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/pstore.rb b/lib/pstore.rb
index dd74f4fc2f7..93795495fca 100644
--- a/lib/pstore.rb
+++ b/lib/pstore.rb
@@ -24,9 +24,6 @@ class PStore
unless File::directory? dir
raise PStore::Error, format("directory %s does not exist", dir)
end
- unless File::writable? dir
- raise PStore::Error, format("directory %s not writable", dir)
- end
if File::exist? file and not File::readable? file
raise PStore::Error, format("file %s not readable", file)
end
@@ -93,7 +90,7 @@ class PStore
value = nil
backup = @filename+"~"
begin
- file = File::open(@filename, "rb+")
+ file = File::open(@filename, read_only ? "rb" : "rb+")
orig = true
rescue Errno::ENOENT
raise if read_only