I tested it on a local cluster with the following code:
protected override async Task RunAsync(CancellationToken cancellationToken) { while (true) { cancellationToken.ThrowIfCancellationRequested(); string filename = "testFile.txt"; File.AppendAllText(filename, "test. "); string content = File.ReadAllText(filename); System.Diagnostics.Trace.WriteLine("Content:" + content); System.Diagnostics.Trace.WriteLine(new FileInfo(filename).FullName); await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken); } }
Result of the result:
Content:test. C:\SfDevCluster\Data\_App\_Node_3\SampleAppType_App51\work\testFile.txt Content:test. test. C:\SfDevCluster\Data\_App\_Node_3\SampleAppType_App51\work\testFile.txt Content:test. test. test. C:\SfDevCluster\Data\_App\_Node_3\SampleAppType_App51\work\testFile.txt
But the path was changed the next time it started on C: \ SfDevCluster \ Data_App_Node_3 \ SampleAppType_App52 \ work \ testFile.txt.
So, I suppose the answer is:
It is possible to use a local file system, but only for temporary files. And I think it is good practice to clean the system at the end of the iteration.
source share