フィルターのクリア

Checking partition format before saving.

3 ビュー (過去 30 日間)
D. Plotnick
D. Plotnick 2018 年 3 月 22 日
コメント済み: D. Plotnick 2018 年 3 月 22 日
Hello, I was wondering if there is a simple way to get the format (NTFS, FAT32, etc.) of a directory.
The issue is that I may generate and save files of sizes from a few hundred MB up to multiple GB. I already have a switch that checks whether the save is going to be over 2GB, and so to use the '-v7.3' flag (which is slower, so I avoid it when possible), but I just ran into an external FAT32 formatted drive, and FAT32 has hard single-file size limits (in the 4GB range).
I want to be able to check the format of the drive for a target directory, and use switch/case so that if it is in FAT32 I can pop up a ui prompt asking to find another save location.
Any suggestions?

採用された回答

Jan
Jan 2018 年 3 月 22 日
編集済み: Jan 2018 年 3 月 22 日
At least under Windows this replies the file system of the drive "D:":
di = System.IO.DriveInfo('D');
FileSystem = char(di.DriveFormat)
With java:
p = java.nio.file.Paths.get('D:\', '.');
store = java.nio.file.Files.getFileStore(p);
FileSystem = char(store.type())
  1 件のコメント
D. Plotnick
D. Plotnick 2018 年 3 月 22 日
The former method worked perfectly. Cheers, helpful as always Jan.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by