Skip to content

Instantly share code, notes, and snippets.

View acatarineu's full-sized avatar

Alex Catarineu acatarineu

View GitHub Profile
@acatarineu
acatarineu / truncat.c
Created November 17, 2023 14:27
cat and truncate input file from beginning as we go
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define SIZE 4096
#define FALLOCATE_COUNT (4096 * 64) // Truncate every 1GB, assuming block size is 4096
// cat and truncate input file from beginning as we go

Keybase proof

I hereby claim:

  • I am acatarineu on github.
  • I am acatarineu (https://keybase.io/acatarineu) on keybase.
  • I have a public key ASDjFRcPyVBj1FHW5nw0WsMOH_i3QcHltrxPjwOb4ccgxQo

To claim this, I am signing this object: