distributed-computing/tasks/klementeva-ja/lab_2/worker-1/Program.cs

13 lines
392 B
C#
Raw Normal View History

2023-11-03 22:22:15 +04:00
var files = Directory.GetFiles("/var/data");
int maxCount = 0;
string lagrestFile = "";
foreach(var file in files){
var lines = File.ReadAllLines(file);
if(lines.Count() > maxCount){
maxCount = lines.Count();
lagrestFile = file;
}
}
if(File.Exists("/var/result/data.txt"))
File.Delete("/var/result/data.txt");
File.Move(lagrestFile, "/var/result/data.txt");