From: Gabriele Marrone Date: 2006-11-03T19:15:08+09:00 Subject: Re: webrick-webdav(gem) served files are mounted only read-only Il giorno 03/nov/06, alle ore 10:11, Dirk L�sebrink ha scritto: > while i easily get a webdav server up an running with > > gem install webrick-webdav > > and > > require 'webrick' > require 'webrick/httpservlet/webdavhandler' > > server = WEBrick::HTTPServer.new(context.values) > server.mount("/webdav", WEBrick::HTTPServlet::WebDAVHandler, > Dir.pwd) > ... > > and can mount and read the files, i still can't actually modify any of > the exported/mounted webdav files. > > before i start diving into real problem tracking i would like to > ask if > someone of you had the same problems? i export/mount on mac os x. > might > this be a mac or a webrick-webdav problem? any tips welcomed, > > have fun > dirk Exactly, that's a Mac OS X issue: webrick-webdav supports protocol version 1.0, while Mac OS X wants the server to support v2.0 in order to let you write on that share. I had the same problem as yours, but I couldn't find enough documentation anywhere (about webrick-webdav or about the version required by OS X) so I started reading webrick-webdav sources and comparing the traffic dump with an apache webdav module and I found out this version issue. Actually I think that the only difference between 1.0 and 2.0 servers is that the latter ones support LOCK methods, which allow to lock files (exclusive or shared locks). I didn't need this, so I just inherited from WebDAVHandler: module WEBrick module HTTPServlet class WebDAVHandlerVersion2 < WebDAVHandler def do_OPTIONS(req, res) super res["DAV"] = "1,2" end end end end So I started using WebDAVHandlerVersion2 instead of WebDAVHandler. In fact, on the source code of WebDAVHandler there is a commented out 'res["DAV"] = "1,2"' line... It worked, I'm quite sure I could write to that share, but right now it seems like it doesn't work very well with OS X: I get strange errors when writing into a file or creating a new one. Some time ago I wrote a page about my experiments with WebDAV, since I couldn't find enough documentation: http://gmarrone.objectblues.net/ cgi-bin/wiki/WebDAV_-_Linux_server%2c_Mac_OS_X_client . I summed up almost everything in this mail, but maybe you can find something useful over there :) It isn't up to date, though: I don't describe the errors I get now with that solution. Please let me know if your Mac OS X is able to write without any error on that modified version of webrick-webdav :)