diff --git a/src/vtestream-file.h b/src/vtestream-file.h index bcd68df..bb42413 100644 --- a/src/vtestream-file.h +++ b/src/vtestream-file.h @@ -243,10 +243,21 @@ static void _file_write (int fd, const char *data, gsize len, gsize offset) { gsize ret; +static guint64 total = 0; +static int totalfd = -1; +char buf[100]; if (G_UNLIKELY (fd == -1)) return; +if (G_UNLIKELY (totalfd == -1)) { +sprintf(buf, "/tmp/gnome-terminal-vte-stream-written-%d", getpid()); +totalfd = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0600); +} +total += len; +sprintf(buf, "%lu\n", total); +pwrite(totalfd, buf, strlen(buf), 0); + while (len) { ret = pwrite (fd, data, len, offset); if (G_UNLIKELY (ret == (gsize) -1)) {