check_free_space_in_dir

astropy.utils.data.check_free_space_in_dir(path, size)[source]

Determines if a given directory has enough space to hold a file of a given size. Raises an OSError if the file would be too large.

Parameters
pathstr

The path to a directory

sizeint

A proposed filesize (in bytes)

Raises
OSErrorThere is not enough room on the filesystem