locked
Can Wildcard be used for FileSyncScopeFilter SubdirectoryExcludes? RRS feed

  • Question

  • Hi,

    I am getting an exception from the following:

    Microsoft.Synchronization.Files.FileSyncScopeFilter SrcFilter = new FileSyncScopeFilter();
    SrcFilter.SubdirectoryExcludes.Add("*");

    FileSyncProvider sourceProvider =

    new FileSyncProvider(sourceId, sSrcLocation, SrcFilter, options); <-- Exception "The specified path contains invalid characters".

    I read on another post about problem using wildcard with the FileSyncScopeFilter, but according to the following link, "Wildcards (* and ?) can be used".  http://msdn.microsoft.com/en-us/library/bb904479.aspx

    Is the above link out of date?

    I have Microsoft Sync Framework v.2 CTP1, VS 2005 version 8, C#

    Thanks a lot.

    • Moved by Max Wang_1983 Thursday, April 21, 2011 5:37 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Monday, April 6, 2009 8:34 PM

Answers

  • Hi,

    You are right, it doesn't work for me either.

    I also learnt that wild-cards aren't supported in the subdirectory exclude filter. Wild-cards can be used for files though.
    For subdirectory exclusion, one can specify relative or absolute paths.

    File Sync Provider might be fixed to handle wild-cards in subdirectory exclude in a future release.
    In the meantime, we would update the documentation to reflect this.

    Thanks,
    Sameer
    Wednesday, April 8, 2009 6:24 PM

All replies

  • Hi Ohanna,

    Thanks for reporting this issue. I was able to reproduce your problem and am following up with the developer.

    Btw, I may have a temporary work around for you - if you add anything to the subdirectory exclude filter before adding "*",  FileSyncProvider constructor doesn't throw above exception. For now, you can consider adding a non-existing directory name - see if it gets you beyond this issue.

    Thanks,
    Sameer
    Tuesday, April 7, 2009 5:50 AM
  • Thanks Sameer.

    I followed your suggestion but it doesn't seem to work for me.  Could you let me know if the following is what you meant please?

    SrcFilter.SubdirectoryExcludes.Add( + "NonExisting");

    // I tried  following one by one
    SrcFilter.SubdirectoryExcludes.Add(sSrcLocation + "*");
    // SrcFilter.SubdirectoryExcludes.Add("*");

    sourceProvider = new FileSyncProvider(sourceId, sSrcLocation, SrcFilter, options); <-- Exception "The specified path contains invalid characters" is raised

    I confirmed that just the

    SrcFilter.SubdirectoryExcludes.Add( + "NonExisting");

    doesn't cause the exception.

    Thanks again for your help.  Really appreciate it.

    Tuesday, April 7, 2009 5:44 PM
  • Hi,

    You are right, it doesn't work for me either.

    I also learnt that wild-cards aren't supported in the subdirectory exclude filter. Wild-cards can be used for files though.
    For subdirectory exclusion, one can specify relative or absolute paths.

    File Sync Provider might be fixed to handle wild-cards in subdirectory exclude in a future release.
    In the meantime, we would update the documentation to reflect this.

    Thanks,
    Sameer
    Wednesday, April 8, 2009 6:24 PM
  • I see.  Thank you Sameer.
    Wednesday, April 8, 2009 8:30 PM