Skip to main content
`Ctrl`+`K`

# get_free_space_in_dir

astropy.utils.data.get_free_space_in_dir(path, unit=False)

  Given a path to a directory, returns the amount of free space on that filesystem.

  Parameters:
    path `python:str`, `os.PathLike`

      The path to a directory.

    unit bool or `Unit`

      Return the amount of free space as Quantity in the given unit, if provided. Default is `False` for backward-compatibility.

  Returns:
    free_space `python:int` or `Quantity`

      The amount of free space on the partition that the directory is on. If `unit=False`, it is returned as plain integer (in bytes).