-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (35 loc) · 1.33 KB
/
Copy pathProgram.cs
File metadata and controls
41 lines (35 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.IO;
using System.Threading;
namespace NLB
{
internal class Program
{
private static void Main(string[] args)
{
string folderPath = args[0];
string writeableLocation = args[1];
string id = args[2];
string flagFile = Path.Combine(writeableLocation, id + "_END");
File.Delete(flagFile);
string resultsFile = Path.Combine(writeableLocation, id + "_RESULTS");
File.Delete(resultsFile);
Console.Out.WriteLine("Now monitoring " + folderPath + " for all file changes");
Console.Out.WriteLine("Will continue monitoring until file " + flagFile + " is created");
Console.Out.WriteLine("Results will be written to " + resultsFile);
var buildWatcher = new BuildWatcher(folderPath, flagFile);
while (File.Exists(flagFile) == false)
{
Thread.Sleep(5000);
}
buildWatcher.EndMonitoring();
// Write the string to a file.
var file = new StreamWriter(resultsFile);
foreach (string filePath in buildWatcher.BuildArtefacts)
{
file.WriteLine(filePath);
}
file.Close();
}
}
}