/*
 * @(#)growisofs.cpp
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 1999-2003 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 <string.h>
#include <unistd.h>

/**
 * A simple growisofs simulation
 *
 * @version 20031017
 * @author Jörg P. M. Haeger
 */
int main(int argc, char *args[]) {
	if (argc >= 2)
		if (strcmp(args[1], "-version") == 0) {
			printf("growisofs 5.10 simulation for webCDwriter\n");
			return 0;
		}

	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;
}
