From 6d481a4ae440532dcf674adf910c5cfa802f4679 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 7 Jan 2003 07:36:40 +0000 Subject: * hash.c (env_clear): new Hash compatible method. * hash.c (env_shift): ditto. * hash.c (env_invert): ditto. * hash.c (env_replace): ditto. * hash.c (env_update): ditto. * array.c (rb_ary_join): dispatch based on "to_str". * array.c (rb_ary_times): ditto. * array.c (rb_ary_equal): ditto. * process.c (rb_f_exec): dispatch based on "to_ary". * eval.c (umethod_bind): exact class match is not required. relax the restriction to subclasses. * eval.c (rb_eval): call "inherited" before executing class body. * class.c (rb_define_class): call "inherited" after defining the constant. * class.c (rb_define_class_under): ditto. * eval.c (massign): expand first element if RHS is an array and its size is 1, and LHS has concrete assignment target (i.e. LHS has target(s) other than *var). * eval.c (massign): avoid unnecessary avalue/svalue conversion. * eval.c (rb_yield_0): ditto * array.c (rb_ary_update): do not allocate unused array if rpl is nil (i.e. merely removing elements). * io.c (io_read): should resize supplied string if it's shorter than expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pstore.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/pstore.rb b/lib/pstore.rb index dd74f4fc2f..93795495fc 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 -- cgit v1.2.3