filerail/utils.h
// check if there is enough storage size (resource size is sent by client)
check if there is enough storage size (resource size is sent by client)
check if there is enough storage size ( resource size is sent by client )
bool filerail_check_storage_size(off_t resource_size) {
	struct statvfs buf;
	if (statvfs("/", &buf) == -1) {
		LOG(LOG_USER | LOG_ERR, "utils.h filerail_find_available_size statvfs\n");
		return false;
	}
	return (resource_size / buf.f_frsize) < buf.f_bavail;
}
bool filerail_check_storage_size ( off_t resource_size ) { struct statvfs buf ; if ( statvfs ( " " , & buf ) == -1 ) { LOG ( LOG_USER | LOG_ERR , " \n " ) ; return false ; } return ( resource_size / buf . f_frsize ) < buf . f_bavail ; }
check if there is enough storage size (resource size is sent by client)
check if there is enough storage size ( resource size is sent by client )
// man statvfs, you will get it. (Basically checking if there exists enough memory blocks)