I am creating a File and at the same time writing 3 lines to this file and then closing the file.
What I wonder is if the fileSystemWatcher has any event that detects when I have done exactly this operation and closed the file.
I want the filesystemwatcher to react After this file is closed and not during writing.
Is that possible ?
String^ Path = "C:\\Folder1\\file1.txt";
FileStream^ hr = new FileStream(Path, FileMode::Create, FileShare::ReadWrite);
StreamWriter^ WriteFile = gcnew StreamWriter(hr);
for (int i = 0; i < 5; i++)
{
WriteFile->WriteLine(Convert::ToString(i));
}
WriteFile->Close();//Close file