/*
 * @(#)growisofs.cpp
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 1999-2002 Jörg P. M. Haeger
 *
 * webCDwriter is free software. See CDWserver.cpp for details
 *
 * Jörg P. M. Haeger, 08.11.2002
 */

#include <stdio.h>
#include <unistd.h>

/**
 * A simple growisofs simulation
 *
 * @version 20021123
 * @author Jörg P. M. Haeger
 */
int main(int argc, char *args[]) {
	int blocksNew = 100000;
	int blocksUsed = 238368;
	printf("Executing 'mkisofs -C 16,%d -M /dev/fd/6"
		" -joliet -follow-links -full-iso9660-filenames -rational-rock"
		" -verbose -gui"
		" ."
		" | dd of=/dev/scd0 obs=32k seek=%d'\n",
		blocksUsed, blocksNew / 16);
	printf("mkisofs 1.15a15 (i586-mandrake-linux-gnu)\n");

	for (int i = 1; i < 23; i++) {
		printf("% 6.2f%% done, estimate finish Tue Nov 12 19:22:19 2002\n",
			100.0 * i / 23.0);
		fflush(stdout);
		sleep(1);
	}

	printf("%d extents written (%d Mb)\n",
		(blocksUsed + blocksNew),
		(blocksUsed + blocksNew) / 512);

	return 0;
}
