chickadee » srfi-170 » file-space

file-space fname/portprocedure

Returns the amount of free space in bytes on the same volume as the file path (if it is a string) or the file open on port (if it is a port). This allows the application to detect if the disk is getting full. Use path if the file has not yet been created, or port if it is already open.

fname/port
path or Scheme port