Can I copy a file? Raise an exception is space constraints not met.
@param fromPath Path from which the file is being copied
@param toPath Path to which the file is being copied
Definition at line 624 of file ingest.py.
625 """Can I copy a file? Raise an exception is space constraints not met.
627 @param fromPath Path from which the file is being copied
628 @param toPath Path to which the file is being copied
630 req = os.stat(fromPath).st_size
631 st = os.statvfs(os.path.dirname(toPath))
632 avail = st.f_bavail * st.f_frsize
634 raise RuntimeError(
"Insufficient space: %d vs %d" % (req, avail))