def file_size(bucket, file_path):
    """Get the size of a file. Raises an exception if the file is not found

    Args:
        bucket (boto.s3.bucket.Bucket):
        file_path (str):

    Returns:
        int: file size in bytes
    """
    key = bucket.get_key(file_path)
    if not key:
        raise IOError('file %s does not exist in bucket %s' % (file_path, bucket))

    return key.size