Mark
The way we have it structured is that the destination file is locked. This is where the users have access to the templates. The source file/location is never locked - this is where the developers update the templates to put to the destination.
As one of the people suggested, perhaps the best way to approach this is to rsh to the filer, get the list of username's that have the file opened, then running through a regexp, and then terminating the user's cifs sessions. This job can be scheduled on the weekend or in the wee hours of the morning when we are certain that the file is not needed.
-- Clarence.
It may be possible to rename the file to get it out of the way and then copy the new file into place. I think this will work because renaming a file does nothing to the file itself. It only affects directory entries that refer to the file. If a CIFS user has the file open, renaming should not matter. I don't know enough about CIFS to say if this will actually work, but it's worth a try.
rename target target.old copy original target delete target.old
The delete might fail if the file is open, so you may have to try again later. Also you might want to use the date and time instead of .old so that you don't run into problems with a previous .old file. And if you don't want to clutter the template folder, you could rename the old files into a different folder, kind of like a wastebasket.
Another possibility would be to create a completely new folder of templates and rename it into place, renaming the old template folder out of the way:
make folder templates.new copy all templates into templates.new rename folder templates to templates.old rename folder templates.new to templates delete folder templates.old (if possible)
Steve Losen scl@virginia.edu phone: 434-924-0640
University of Virginia ITC Unix Support