distributed-computing/tasks/mironov-eo/lab_2/worker-1/Program.cs

9 lines
265 B
C#
Raw Normal View History

2023-10-31 00:41:47 +04:00
Random random = new Random();
var fileArray = Directory.GetFiles("/var/data");
string file = fileArray[random.Next(fileArray.Length)];
if (File.Exists("/var/result/data.txt"))
{
File.Delete("/var/result/data.txt");
}
File.Move(file, "/var/result/data.txt");