packrat.c
// Append data to the .prd file
Append data to the .prd file
Append data to the . prd file
static off_t packrat_addFile(const int prd, const off_t len, const char * const data) {
	if (prd < 0 || len < 1 || data == NULL) return 0;
	const off_t pos = lseek(prd, 0, SEEK_END);
	if (pos < 0) return pos;
	ssize_t bytesWritten = write(prd, data, len);
	return (bytesWritten == (ssize_t)len) ? pos : -1;
}
static off_t packrat_addFile ( const int prd , const off_t len , const char * const data ) { if ( prd < 0 || len < 1 || data == NULL ) return 0 ; const off_t pos = lseek ( prd , 0 , SEEK_END ) ; if ( pos < 0 ) return pos ; ssize_t bytesWritten = write ( prd , data , len ) ; return ( bytesWritten == ( ssize_t ) len ) ? pos : -1 ; }
Append data to the .prd file
Append data to the . prd file