From: Alexei S. <ale...@gm...> - 2012-06-25 16:30:25
|
On Sun, Jun 24, 2012 at 3:46 PM, Charles Srstka < bas...@ch...> wrote: > > I just tested this on Snow Leopard and Lion, and it works. When you’ve got > a disk image mounted, open(path, O_RDWR | O_EXLOCK | O_NONBLOCK) fails with > EAGAIN. If I’ve got a disk image open with O_EXLOCK and then I try to mount > it in the Finder, DiskImageMounter fails with “Resource temporarily > unavailable”. So this should do what you want without having to monkey with > permanent metadata bits on the file. > Cool! Does this work well if SheepShaver crashes? (e.g. does the lock get removed in that case?) -Alexei |