Is there a touch() for .NET/windows? can use while file is readlocked? [duplicate]
Possible Duplicate:
How to touch a file in C#?
Is there a开发者_如何学C touch() function available? I would like to update the timestamp so my script doesnt delete the file when it becomes X old. Another issue is it should work when the file is locked for reading by another process.
You might want to look into the FileInfo class. You can set LastWriteTime, LastAccessTime etc from there.
If the file is locked, you may run into a problem, but it's amazing what you CAN do to a locked file.
精彩评论