Pre-allocating drive space for file storage

后端 未结 4 1042
挽巷
挽巷 2021-02-06 11:39

Is there a Java way to pre-allocate drive space for exclusive usage in the application?

There is no requirement for this space to be a separate filesystem or a part of

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 12:20

    On Linux systems you can use fallocate() system call. It's extremely fast. Just run Bash command.

    UPD:

    fallocate -l 10G 10Gigfile

提交回复
热议问题