It seems like it should be possible to use a PStore on a read-only
pstore in a read-only directory.  I ran into this when trying to
access one from a CGI script running as 'nobody'.


Index: pstore.rb =================================================================== RCS file: /src/ruby/lib/pstore.rb,v retrieving revision 1.16 diff -u -r1.16 pstore.rb --- pstore.rb 14 Nov 2002 06:18:59 -0000 1.16 +++ pstore.rb 3 Jan 2003 23:28:58 -0000 @@ -24,9 +24,6 @@ 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 @@ 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