S
Salman Zari Ghanvi
When the following code is execute and the file already exists, the file is
not actually deleted (in file properties - created date does not change) -
but only the modified and accessed date changes.
No exception is raised.
How can I ensure that file is actually deleted? I want to raise create event
for another application which is monitoring this folder similar to file
system watcher.
Thanks.
if (!File.Exists(fileName))
{
File.Delete(fileName);
}
using (StreamWriter sw = new StreamWriter(fileName,false))
{
sw.Write(content);
sw.Flush();
}
not actually deleted (in file properties - created date does not change) -
but only the modified and accessed date changes.
No exception is raised.
How can I ensure that file is actually deleted? I want to raise create event
for another application which is monitoring this folder similar to file
system watcher.
Thanks.
if (!File.Exists(fileName))
{
File.Delete(fileName);
}
using (StreamWriter sw = new StreamWriter(fileName,false))
{
sw.Write(content);
sw.Flush();
}