public CreateAutoDeleteFiles(IList <FileInfo> files, bool fillWithBytes = false, int fillBufferSize = 10)
        {
            _files = files;

            foreach (FileInfo info in _files)
            {
                if (fillWithBytes)
                {
                    byte[] bytes = new ByteGenerator().GenerateBytes(fillBufferSize);
                    using (FileStream fileStream = File.Create(info.FullName, bytes.Length, FileOptions.WriteThrough))
                    {
                        fileStream.Write(bytes, 0, bytes.Length);
                    }
                }
                else
                {
                    using (File.Create(info.FullName))
                    {
                    }
                }
            }
        }
Пример #2
0
        public string GenerateTempDirectoryName(int length = 10)
        {
            string name = new ByteGenerator().GenerateBytesString(length);

            return(name);
        }