Lucene.Net.Store.FSDirectory.Sync C# (CSharp) Method

Sync() public method

public Sync ( ICollection names ) : void
names ICollection
return void
        public override void Sync(ICollection<string> names)
        {
            EnsureOpen();
            ISet<string> toSync = new HashSet<string>(names);
            toSync.IntersectWith(StaleFiles);

            foreach (var name in toSync)
            {
                Fsync(name);
            }

            // fsync the directory itsself, but only if there was any file fsynced before
            // (otherwise it can happen that the directory does not yet exist)!
            if (toSync.Count > 0)
            {
                IOUtils.Fsync(directory.FullName, true);
            }

            StaleFiles.ExceptWith(toSync);
        }