Home
TeamSite
How to unlock/lock ALL attached files at once?
B80116
In one of our workflows, an editor adds some files (which were locked by him) to a user task. In a subsequent external task, I use iwunlock.exe and iwlock.exe to change the lock owner of these files to a different person. (I do this to ensure that no one, even the original editor of the files, changes them.)
Sometimes our users attach folders, not just files, to the workflow, and sometimes the folders contain folders, etc. I needed to make sure all the files in those folders got unlocked and locked. The CLT manual says that iwunlock and iwlock can be used to lock/unlock any file OR directory, but when I attempted to use them on directories, they didn't unlock/lock files in those directories.
So, the Perl scripts I ended up writing to do the locking and unlocking call themselves recursively to drill down through any attached folders to unlock/lock all files.
When lots of files and folders have been attached to the workflow, this process naturally takes a long time.
Does anyone know of a faster way to do this? Are there command line tools that I have overlooked which already do this? (That is, which unlock or lock ALL files attached to a task, even those in folders, in one fell swoop, instead of just one file at a time?)
TS 6.1, Windows 2000
Find more posts tagged with
Comments
Adam Stoller
You can use iwlistlocks with the full vpath (up to and including the directory) to get a list of all files currently locked, and then use iwunlock on that.
You can then either use the same list with iwlock *or* use something like File::Find to recurse through a directory and run iwlock on each *file* found.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com