Odd behaviour when deleting Files with Files.delete()

后端 未结 2 1601
余生分开走
余生分开走 2020-12-05 05:10

Please consider the following example Java class (pom.xml below):

package test.filedelete;

import java.io.ByteArray         


        
2条回答
  •  失恋的感觉
    2020-12-05 05:45

    If Files.delete did not throw exception it means it deleted the file. Files.delete javadoc says that "on some operating systems it may not be possible to remove a file when it is open and in use by this Java virtual machine or other programs".

提交回复
热议问题