zipfs and write support
Alan.Bateman at Sun.COM
Thu Jan 28 00:46:05 PST 2010
Joel Uckelman wrote:
> I don't know of any way to stop other proceses from corrupting the
> underlying ZIP file. Do you? I thought file locks were advistory on
> many OSes. I'm not familiar with what would need to be done to
> coordinate across VMs. Is there a compelling reason to do this? It's
> an unusual requirement.
Yes, to be portable, it is best to assume the file locking is advisory.
But, file locking isn't going to help when you are replacing the zip
file (which I assume is going to happen as it is based on
java.util.zip). An approach that I think I've suggested before is to use
a "server" to coordinate access. That would allow applications in
different VMs to access the "file system" concurrently. It could uses
the default file system as a temporary location for updates and re-build
the the zip file file when the file system is closed or the server is
shutdown. Clearly this is would be a more ambitious project and I'm just
mentioning it as a potential solution that someone might like to pursue.
More information about the nio-dev