开发者

Is there a touch() for .NET/windows? can use while file is readlocked? [duplicate]

开发者 https://www.devze.com 2022-12-23 02:01 出处:网络
This question already has answers here: Closed 10 years ago. Possible Duplicate: How to touch a file in C#?
This question already has answers here: Closed 10 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号