fcntl cooperation with server side processes
cmg at dok.org
Thu Jul 22 00:37:18 GMT 2004
David Collier-Brown wrote:
> Hmmn, as a command-like parameter, perhaps, called
> something like --wait-for-exclusive_open ??
> Chris, this might be a suitable approach... opinions?
I really think think the smbstatus + grep is the best cross platform
solution for me right now. My main concern is making sure the entire
file is there so as long as I can see the file's status and know it's in
the process of being modified so that I can process the file and delete
it. If I needed fancier semantics than that, I'd have no problem
writing a custom windows program to ensure the lock gets there.
If I understand correctly, the oplocks that say DENY_ALL will cause an
smbclient get to fail or block ( not sure on semantics and my notes are
at work ) so if I were to smbclient from myself, things would just
work. The only problem would be attempting to connect to a remote
system and ensure that files are being copied. In that case, being
able to specify the Deny Mode would be useful.
Under Linux 2.4+, I think the problem is solved for me by attempting to
do a F_SETLEASE for a write lease.
As long as any other process has the file open, the kernel won't pass
out a write lease.
The only problem with this method is that Linux returns an EACCESS
unless the uid of the file owner == uid of the file process.
I've mailed the last 2 people that did changes to Linux to add the
leases to see why that is. My feeling is that write leases should be
granted to anyone that has write permission to the file.
Does anyone know what the access restrictions are under IRIX?
More information about the samba-technical