I'm trying to view files in my workspace, eventually I want to use GetSyncedFiles() to simply view the current state of the files and what revision it is so I can alert the user. But I can't perform the most simple operation with no flags.
The message to the exception is "GetSyncedFiles has no valid options\r\nParameter name: options".
I've tried omitting the file list and setting different flags in the options, always the same result.
try
{
Perforce.P4.Server srv = new Perforce.P4.Server(new ServerAddress(PerforceServer + ":" + PerforcePort));
Repository epo = new Perforce.P4.Repository(srv);
repo.Connection.UserName = PerforceUser;
repo.Connection.SetClient(PerforceWorkspace);
repo.Connection.Client.Name = PerforceWorkspace;
repo.Connection.Connect(new Perforce.P4.Options());
repo.Connection.Login(PerforcePassword);
List<FileSpec> fileSpecs = new List<FileSpec>();
foreach (var filename in Directory.GetFiles(DirectoryWithTargetFiles))
{
fileSpecs.Add(new FileSpec(new ClientPath(filename)));
}
SyncFilesCmdOptions cmdFlags = new SyncFilesCmdOptions(SyncFilesCmdFlags.None);
FileSpec[] fsa = fileSpecs.ToArray();
var someFiles = m_repo.Connection.Client.GetSyncedFiles(cmdFlags, fsa);//execution gets to here
}
catch (Perforce.P4.P4Exception e)
{
Console.WriteLine(e.Message);
}
catch (Exception ee)
{
//this exception will hit
Console.WriteLine(ee.Message);
}