Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - FILE LOCKING / prevent editing while file open by other user
FILE LOCKING / prevent editing while file open by other user
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Mar 01, 2005 12:53 pm    Post subject:

jonny> wrote:
2) Mac OS 10.3 Server. The drive being shared is formatted in Mac OS Extended (Journaled) being shared using AFP.


This is the key. AFP does not support file locking. Any file locking calls on an AFP file will return ENOTSUP which means "nice try, but we at Apple didn't get around to implementing remote file locking in the Unix fcntl() function."

The gist of this is that in order to implement locking of AFP files, I would need to hunt down all of the file locking calls in the OpenOffice.org code and replace them with code that invokes Apple's special AFP file locking functions if the file is on an AFP volume.

This is not a trivial amount of work and, as such, would require a donor to fund it.

Patrick
Back to top
Terry Teague
Guest





PostPosted: Wed Mar 02, 2005 2:04 am    Post subject: Re: File Locking

pluby wrote:
jonny> wrote:
2) Mac OS 10.3 Server. The drive being shared is formatted in Mac OS Extended (Journaled) being shared using AFP.


This is the key. AFP does not support file locking. Any file locking calls on an AFP file will return ENOTSUP which means "nice try, but we at Apple didn't get around to implementing remote file locking in the Unix fcntl() function."

The gist of this is that in order to implement locking of AFP files, I would need to hunt down all of the file locking calls in the OpenOffice.org code and replace them with code that invokes Apple's special AFP file locking functions if the file is on an AFP volume.

This is not a trivial amount of work and, as such, would require a donor to fund it.

Patrick

Thanks Patrick for the explanation.

For those of you are interested, a more technical explanation can be found at :

http://developer.apple.com/technotes/tn/tn2037.html

And a starting point for the relevant source code in OOo :

sal/osl/unx/file.c

Regards, Terry
Back to top
darbycrash
Guest





PostPosted: Tue Mar 29, 2005 1:25 pm    Post subject:

Quote:
pluby> wrote:This is the key. AFP does not support file locking.



Patrick,

The locking issue that LAW and jonny are talking about also occurs when sharing a drive using SMB instead of AFP. Is there any possibility of achieving our file locking goal using SMB sharing instead, or does that still require hunting down the file locking calls in OpenOffice?

-Bryan
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Wed Mar 30, 2005 12:21 am    Post subject:

darbycrash wrote:
The locking issue that LAW and jonny are talking about also occurs when sharing a drive using SMB instead of AFP. Is there any possibility of achieving our file locking goal using SMB sharing instead, or does that still require hunting down the file locking calls in OpenOffice?


Most likely, the same OOo code is failing for both AFP and SMB. The unknown is why are the Unix file locking calls that OOo uses failing for SMB? Does you SMB server not support remote file locking or does Mac OS X's SMB client implementation not support file locking?

These are the questions that would need to be answered. Unfortunately, I don't have much time to do this but if there are any C developers out there that could write some test code, the OOo code call the fcntl() function with F_SETLK. If I knew what error values to look for (e.g. this function will return an error and set the errno global variable to ENOTSUP for AFP files) and what alternative functions I could try to use in such cases, I could splice the test code into Neo/J.

Patrick
Back to top
fa
The Architect
The Architect


Joined: May 27, 2003
Posts: 88

PostPosted: Sun Apr 03, 2005 3:03 pm    Post subject:

I may be able to give this a poke and see what happens, at least on SMB shares using Samba (3.0.3). I could test AppleShare from OS 9 but that would have to wait until Monday.
Back to top
Guest
Guest





PostPosted: Wed Apr 06, 2005 9:18 am    Post subject:

fa,

We need you to kindly report back in at the "Changing the exterior color of the Main Window" thread.

Pat needs someone to write the patch.

Thank you.

Sincerely,

The Board of the Sick of the Drab "Windoze Gray" Color Club
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Goto page Previous  1, 2
Page 2 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.