title: Force a Samba process to close a file
body: <p>Is there a way to force a Samba process to close a given file without killing it?</p>
  
  <p>Samba opens a process for each client connection, and sometimes I see it holds open files far longer than needed.  Usually i just kill the process, and the (windows) client will reopen it the next time it access the share; but sometimes it's actively reading other file for a long time, and i'd like to just 'kill' one file, and not the whole connection.</p>
  
  <p>edit: I've tried the 'net rpc file close ', but doesn't seem to work.  Anybody knows why?</p>
  
  <p>edit: <a href="http://www.nabble.com/Fw:-Files-left-open-td5578614.html" rel="nofollow noreferrer">this</a> is the best mention i've found of something similar. It seems to be a problem on the win32 client, something that microsoft servers have a workaround for; but Samba doesn't.  I wish the <code>net rpc file close &lt;fileid&gt;</code> command worked, I'll keep trying to find out why.  I'm accepting LuckyLindy's answer, even if it didn't solve the problem, because it's the only useful procedure in this case.</p>