no "rename" operation in C# !!!
- this has been covered in this group before, but I can't find any good
answers.
what I am trying to do is refresh the content in a file with minimum
performance impact on any read operations to that file - a common task
right....
in the unix world the way to do this is to create a temporary file with
the new content, and "rename" the temporary file to the destination
file. This works because the rename operation is atomic in the sense
that the old file is removed and the new file moved without the chance
of some other process accessing the file in between.
this operation is also fast as the rename does not actually move any of
the data on disk (it's an inode manipulation).
....I can't find how to do this in C# !
the File.Move operation is no good because it throws an exception if
the target file already exists.
File.Delete, File.Move is also no good because it is not atomic....
any ideas?
thanks,
Oli@TigerTechSoftware