How can I tell what processes are using a file under Java in Windows?

前端 未结 4 1734
无人及你
无人及你 2021-02-14 04:40

We have a scheduled task written in Java that is failing on Windows platforms because sometimes the files it needs to delete are still in use. Is there a way from within Java t

4条回答
  •  爱一瞬间的悲伤
    2021-02-14 05:08

    You can use the excellent Sysinternals Process Explorer to do this, and it's not limited to Java processes.

    See this posting for details. I don't know how to invoke this functionality from java, however.

提交回复
热议问题