/* convert fdd image from 360K to 1.2M
 * handle with care, destination *will* be overwitten */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc,char *argv[])

#define USIZE 512*15

{
if(argc!=3)
	{
	fprintf(stderr,"%s <infile> <outfile>\n",argv[0]);
	return -1;
	}
void *buf=malloc(USIZE);
void *z=malloc(USIZE);
bzero(z,USIZE);
int i=0,p=0,ct=0;
int sfd,dfd,dfd2;
sfd=open(argv[1],O_RDONLY);
dfd=open(argv[2],O_CREAT | O_TRUNC | O_EXCL | O_WRONLY,0666);
for(ct=0;ct<80;ct++) // 40 tracks, 2 sides
	{
	read(sfd,buf,9*512);
	write(dfd,buf,9*512); // only the first 9 sectors are importand
	write(dfd,z,6*512); // rest of the track is not needed
	}

for(ct=0;ct<80;ct++) // fill up the remaining image
	{
	write(dfd,z,USIZE);
	}
close(sfd);
close(dfd);
return 0;
}

