In a real file system, the following code would throw FileSystemException with a message "[file]: Device or resource busy" (on Linux).
The memory file system throws exception with message "file still open" when I attempt to delete a file.
However, moving a file does not result in exception
FileChannel.open(sourceFile, StandardOpenOption.WRITE).use { channel ->
channel.tryLock().use {
Files.move(sourcePath, targetPath)
}
}
Expected
FileSystemException with message "[sourcePath]: Device or resource busy".
Actual
No exception is thrown.