Open Files

Mac dmccann at nibsc.ac.uk
Fri Nov 9 06:50:05 GMT 2001


Howdy,

>On a WindowsNT machine I have three directories shared out READONLY.  These
>three directories are mapped to users machines and then they run programs
>out of them.  There are ALWAYS people using files in here.  At times I have
>to update the programs in there and I need to overwrite the files that are
>in there.  Now on this windowsNT machine I cannot seem to do that without
>killing all of the connections and doing it because they are locked due to
>people using them.
>
>Same situation but with SAMBA on a linux machine this time.  I have tried a
>few times and it seems to have no problem overwriting the copies that are on
>disk while people are still using them (at one point I actually deleted all
>of the files in there and it didn't complain).  Is it true that SAMBA will
>allow this or have I just been lucky so far?


Another thing that might just be saving you from grief (as well as
oplocks mentioned another reply to your message) is the fact that in
UNIX, generally speaking, deleting an open file does not cause it to be
removed from disk, until the last process with the file open finishes
using the file.

Even creating a new file with the same name doesn't break this, as the
system can distinguish between a recently-deleted-but-still-open
'file.exe' and a newly created 'file.exe'.

I'm not sure this is really helping you all that much as Windows clients
tend to open files, read bits, close the file and then re-open it later
to read some more.  If you deleted the file during the first open and
replaced it with a new one before the second open you might get a
problem.  This probably applies less to executables though.


                               Mac
          Assistant Systems Adminstrator @nibsc.ac.uk
                        dmccann at nibsc.ac.uk
   Work: +44 1707 654753 x285      Everything else: +44 7956 237670 (anytime)




More information about the samba mailing list