Jeffrey Hutzelman wrote:
On Monday, April 04, 2005 04:01:33 PM -0600 Joseph Galbraith <galb-list%vandyke.com@localhost> wrote:Jeffrey Hutzelman wrote:On Monday, April 04, 2005 08:55:08 AM -0400 Richard Whalen <Whalenr%process.com@localhost> wrote:I like the idea of naming the flags BLOCK_, as it states the actual intention and removes some of the confusion that is out there in the names that various operating systems use. It will also make implementors work to understand what they need to do rather than just match it to the similar sounding name on the operating system (and possibly have it wrong).Me too. I am still a little concerned about the specification of only mandatory locking, when there are common server platforms on which mandatory locking is used infrequently, if at all, while advisory locking is commonplace.Hmmm... I'm not terribly familar with the advisory locking implemenated on most unix platforms (I could dig, I suppose, but that would take me some time.) I presume it has basically three levels of locking, none, read (don't allow writers) and write (exclusive.)Correct. The difference is pretty simple. An advisory lock prevents other processes from obtaining conflicting locks. A mandatory lock also prevents other processes from performing conflicting file accesses.On most Unix systems, an SFTP server can guarantee to its client that I can't get a lock on a file, but it can't guarantee that I won't just write to the file without bothering to get a lock.
I was just locking at the advisory locks under linux (I think I was looking at the advisory locks.) They appear to allow locking of a byte range, not just the whole file? It looks like it would make more sense to support this as a seperate request rather than as part of open? Thanks, Joseph