Locally cached files

David Collier-Brown davecb at Canada.Sun.COM
Thu Jan 7 14:29:18 GMT 1999


You wrote:
A user was creating and deleting a postscipt file in a Unix directory.
She then used Ghostview on the PC client to view this postscript file.
All 
went well the first time, but when she deleted and recreated the file in 
Unix and tried to reread it in Ghostview on the PC, she still got the 
previous version of the file.

	This is a side-effect of oplocks, as you suspected. There are several
	ways of addressing it:
	1. Turn of oplocks on the file (veto oplocks = thisfile/thatfile)
	2. Turn of oplocks on the share (oplocks = no)
	3. Break the lock when recreating the file (this causes
	   the client to clear it's cache).

	The latter can be done by updating the file with either
	smbclient or smbsh, and I suspect that it would be fairly
	easy to write an 'smbtouch" script that triggers an oplock.
	As "touch" uses lseek/llseek, and it's wrapped in source/smbwrappers,
	something like 
	smbsh <<!
	$userid
	$password
	touch $1
	!
	might well do the job.
 
	More properly, LS_PRELOAD=/usr/local/samba/bin/smbwrapper.so touch $1
	would do the job, given $1 as a path rooted in /smb/your-server in each
	case...

	Want to try that and drop me a line?

--dave (avoiding setting up the test client again) c-b
-- 
David Collier-Brown,  | Always do right. This will gratify some people
185 Ellerslie Ave.,   | and astonish the rest.        -- Mark Twain
Willowdale, Ontario   | http://java.science.yorku.ca/~davecb
Work: (905) 477-0437 Home: (416) 223-8968 Email: davecb at canada.sun.com


More information about the samba mailing list