DAS_2024_1/kuzarin_maxim_lab_2/DAaS_FileConnections/Program.cs

30 lines
662 B
C#

using PIHelperSh.RandomEx.Extentions;
string inputPath = Environment.GetEnvironmentVariable("INPUT_PATH") ?? ".\\input1";
string outputPath = Environment.GetEnvironmentVariable("OUTPUT_PATH") ?? ".\\output1";
if(!Directory.Exists(inputPath))
Directory.CreateDirectory(inputPath);
if(!Directory.Exists(outputPath))
Directory.CreateDirectory(outputPath);
var rnd = new Random();
for (int i = 0; i < rnd.Next(1000); i++)
{
using var writer = new StreamWriter(Path.Combine(inputPath, $"{rnd.NextString(10)}.txt"), false);
for (int j = 0; j < rnd.Next(1000); j++)
{
writer.WriteLine(rnd.Next());
}
writer.Close();
}