Necesito calcular el tamaño físico de un directorio. El algoritmo ingenuo para hacer eso podría ser:android tamaño de directorio
public static long getFolderSize(File dir) {
long size = 0;
for (File file : dir.listFiles()) {
if (file.isFile()) {
System.out.println(file.getName() + " " + file.length());
size += file.length();
}
else
size += getFolderSize(file);
}
return size;
}
pero ¿cómo lidiar con los enlaces simbólicos?
enlaces simbólicos significan? – user370305