how can i calculate total size of a folder?
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Pradeep Gowda
am 10 Mai 2015
Beantwortet: Avnet
am 3 Apr. 2024
i'm reading a folder of images , now i wanna display its total size in my GUI. how can i get total size of the folder that i access?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 10 Mai 2015
Note: the meaning if bytes on a directory entry would depend upon your operating system.
0 Kommentare
Weitere Antworten (1)
Avnet
am 3 Apr. 2024
This does the trick:
D = dir('**/*.mat'); % descends current folder and its sub-folders
total_bytes = 0;
for ii = 1:length(D)
total_bytes = total_bytes + D(ii).bytes;
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!