简体   繁体   中英

How to get local workspace mapping using p4api

All I want to know is the location of all the work-spaces which are created on user's local machine using p4api.

eg If user has mapped 'MyProject' workspace at location: "D:\\LocalPerforce\\MyWS" then I want to know this path -> "D:\\LocalPerforce\\MyWS"

I will be having user's necessary information. I came across GetClientFileMappings() but not sure how to user it Or it will help. How to achieve this in c#.

I achieved it with following code workaround:

IList<Client> clients = rep.GetClients(new Options());
                localPaths.AddRange(from client in clients
                                    where !string.IsNullOrEmpty(client.OwnerName) && client.OwnerName.Contains(User)
                                    select client.Root);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM