1

I get a file from Visual SourceSafe using the below code:

IVSSItem vssFile = vssDataBase.get_VSSItem(vssFilePath + @"/" + fileName, false);

VSSItem itemVer = vssFile.get_Version(latestVersionNumber);
itemVer.Get(ref getFilePath, (int)VSSFlags.VSSFLAG_FORCEDIRNO | (int)VSSFlags.VSSFLAG_REPREPLACE | (int)VSSFlags.VSSFLAG_USERRONO);

Visual SourceSafe adds a vssver2.scc file to each folder. Is there a way to prevent this from happening?

I've tried various combinations of the VSSFlags enum with no luck. I don't need to preserve any history and the file will never be checked back in. I just want a clean checkout.

Obligatory disclaimer: I can't switch to another source control program.

1 Answer 1

1

I realized my interest in getting files cleanly via SourceSafe.Interop was more aesthetic than practical. I'm still interested in a solution but I ended up doing this after all the files were checked out.

foreach (FileInfo visualSourceSafeFile in testDirectoryInfo.GetFiles("*.scc", SearchOption.AllDirectories))
{
    visualSourceSafeFile.Attributes = FileAttributes.Normal;
    visualSourceSafeFile.Delete();
}

If you don't change the file attribute to Normal before you delete, you'll probably run into exceptions. Visual SourceSafe marks them as Hidden, System, and ReadOnly.

3
  • When I do a GetFiles( ".scc", SearchOption.AllDirectories ) it doesn't return the *.scc files. Even GetFiles( ".*" ) doesn't show them. Any ideas?
    – Terry
    Jun 6, 2012 at 21:53
  • You need to add an asterisk (*) before the .scc, i.e. "*.scc".
    – Jason
    Jun 13, 2012 at 19:24
  • I had. Figured out my problem. I hadn't 'closed' the VSS database connection so it hadn't written out the *.scc files.
    – Terry
    Jun 14, 2012 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.