How to use scm.exe to query multiple file custom attributes efficiently?
Hi All,
What is the most efficient way of querying custom attributes using scm.exe for multiple files in a directory?
Im currently listing out the files and iterating through each one running a get custom-attribute command, this takes 30-40 seconds per item and having hundreds of items adds a massive amount of execution time to scripts.
Any ideas on better ways to do this?
One answer
Ideas:
-Try using 'lscm' instead of 'scm'. This should keep the SCM daemon running and should speed it up a bit (by avoiding having to start one up every time)
-The 'get custom-attribute' command takes a space separated list of files, so you might want to collect a few files up and then run the command (of course you will have to manage the batching of the files, and parsing of the results).
-Writing your own code using the plain-Java APIs. See: IWorkspaceManager.getCustomAttributes(IVersionableHandle[] state, IProgressMonitor monitor)