简体   繁体   中英

Sort Files in FAT32 without copy them again

I wrote a little program that uses comparators to copy files on a FAT32 drive in the order I want. Eg alphabetical or smallest file first. (Thanks to Java 7)

But if I add new files to the FAT32 drive, all files need to be sorted and copied again, to ensure a correct order.

Is there a way to manipulate the FAT32 table with java? Or another easy solution to sort files without copying?

I am new in the programing world, so I am happy the program works at all. :)

You can

  • create a new directory
  • move (not copy) the files in the order you want using File.rename()
  • delete the old directory.
  • rename the new directory as the old one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM