BTDB.KVDBLayer.OnDiskFileCollection.AddFile C# (CSharp) Method

AddFile() public method

public AddFile ( string humanHint ) : IFileCollectionFile
humanHint string
return IFileCollectionFile
        public IFileCollectionFile AddFile(string humanHint)
        {
            var index = (uint)Interlocked.Increment(ref _maxFileId);
            var fileName = index.ToString("D8") + "." + (humanHint ?? "");
            var file = new File(this, index, Path.Combine(_directory, fileName));
            Dictionary<uint, File> newFiles;
            Dictionary<uint, File> oldFiles;
            do
            {
                oldFiles = _files;
                newFiles = new Dictionary<uint, File>(oldFiles) { { index, file } };
            } while (Interlocked.CompareExchange(ref _files, newFiles, oldFiles) != oldFiles);
            return file;
        }