check free space in a directory

18 visualizaciones (últimos 30 días)
lafnath p
lafnath p el 14 de Nov. de 2016
Respondida: Jan el 14 de Nov. de 2016
How can i check free space inside a directory to write a file

Respuesta aceptada

Jan
Jan el 14 de Nov. de 2016
There is not "free space inside a folder". Folders can be filled with data until the disk is full or if a disk quota for a specific user is reached. You can check the available disk size by:
FileObj = java.io.File(Folder);
free_bytes = FileObj.getFreeSpace;
total_bytes = FileObj.getTotalSpace;
usable_bytes = FileObj.getUsableSpace;
Note that filling a disk to more than 99% (95% is better) might cause a loss of data. If the disk is exhausted, the behaviour is not well defined.

Más respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by