How to use java to realize scrolling and overwriting the previous data after the hard disk is full?

java cooperated with opencv to write a small monitoring software based on usb camera under windows system.
saved on disk in the form of 8 photos per second, resulting in too many fragmented files.
it takes too long to delete using the normal delete command.
is there any way to automatically overwrite the earliest files when the hard drive is full?
or is there a quick way to delete a folder, such as directly changing the file table (not very well understood)?
Thank you

Menu