tanzadeh7
پنج شنبه 27 شهریور 1393, 21:28 عصر
سلام من میخوام در نرم افزار لیست درایو ها رو نمایش بدم.در ویندوز من از کد زیر استفاده میکردم ولی در لینوکس جواب نمیده.
File[] paths;
FileSystemView fsv = FileSystemView.getFileSystemView();
// returns pathnames for files and directory
paths = File.listRoots();
// for each pathname in pathname array
for (File path : paths) {
// prints file and directory paths
System.out.println("Drive Name: " + path);
System.out.println("Description: " + fsv.getSystemTypeDescription(path));
}
خروجی
Drive Name: /
Description: null
File[] paths;
FileSystemView fsv = FileSystemView.getFileSystemView();
// returns pathnames for files and directory
paths = File.listRoots();
// for each pathname in pathname array
for (File path : paths) {
// prints file and directory paths
System.out.println("Drive Name: " + path);
System.out.println("Description: " + fsv.getSystemTypeDescription(path));
}
خروجی
Drive Name: /
Description: null