--- a/src/check.c	2009-05-18 14:01:11.000000000 +0100
+++ b/src/check.c	2011-03-10 12:02:27.747882000 +0000
@@ -41,6 +41,9 @@
 
 static DOS_FILE *root;
 
+int progress_fd = -1;
+static time_t last_progress_time = 0;
+
 /* get start field of a dir entry */
 #define FSTART(p,fs) \
   ((unsigned long)CF_LE_W(p->dir_ent.start) | \
@@ -607,6 +610,16 @@
     dot = dotdot = redo = 0;
     walk = root;
     while (*walk) {
+
+	if(progress_fd >= 0)
+	{
+		if((time(NULL) - last_progress_time) > 2)
+		{
+			write(progress_fd, "dosfsck\n", sizeof("dosfsck\n")-1);
+			last_progress_time = time(NULL);
+		}
+	}
+		
 	if (!strncmp((*walk)->dir_ent.name,MSDOS_DOT,MSDOS_NAME) ||
 	  !strncmp((*walk)->dir_ent.name,MSDOS_DOTDOT,MSDOS_NAME)) {
 	    if (handle_dot(fs,*walk,dots)) {
@@ -870,6 +883,16 @@
 	strncmp(de.name,MSDOS_DOT,MSDOS_NAME) != 0 &&
 	strncmp(de.name,MSDOS_DOTDOT,MSDOS_NAME) != 0)
 	++n_files;
+	
+	if(progress_fd >= 0)
+	{
+		if((time(NULL) - last_progress_time) > 2)
+		{
+			write(progress_fd, "dosfsck\n", sizeof("dosfsck\n")-1);
+			last_progress_time = time(NULL);
+		}
+	}
+	
     test_file(fs,new,test);     /* Bad cluster check */
 }
 
--- a/src/dosfsck.c	2011-03-10 11:54:41.773907415 +0000
+++ b/src/dosfsck.c	2011-03-10 11:30:48.778192695 +0000
@@ -46,14 +46,15 @@
 int atari_format = 0;
 unsigned n_files = 0;
 void *mem_queue = NULL;
-
+extern int progress_fd;
 
 static void usage(char *name)
 {
-    fprintf(stderr,"usage: %s [-aAflrtvVwy] [-d path -d ...] "
+    fprintf(stderr,"usage: %s [-aACflrtvVwy] [-d path -d ...] "
       "[-u path -u ...]\n%15sdevice\n",name,"");
     fprintf(stderr,"  -a       automatically repair the file system\n");
     fprintf(stderr,"  -A       toggle Atari file system format\n");
+    fprintf(stderr,"  -C fd    progress through file descriptor\n");
     fprintf(stderr,"  -d path  drop that file\n");
     fprintf(stderr,"  -f       salvage unused chains to files\n");
     fprintf(stderr,"  -l       list path names\n");
@@ -111,7 +112,7 @@
     interactive = 1;
     check_atari();
 
-    while ((c = getopt(argc,argv,"Aad:fFlnprtu:vVwy")) != EOF)
+    while ((c = getopt(argc,argv,"AaC:d:fFlnprtu:vVwy")) != EOF)
 	switch (c) {
 	    case 'A': /* toggle Atari format */
 	  	atari_format = !atari_format;
@@ -123,6 +124,23 @@
 		interactive = 0;
 		salvage_files = 1;
 		break;
+	    case 'C':
+	    {
+			int fd;
+			
+			progress_fd=atoi(optarg);
+			/* Validate the file descriptor to avoid disasters */
+			fd = dup(progress_fd);
+			if (fd < 0) {
+			    fprintf(stderr,"Couldn't validate file descriptor %d\n", progress_fd);
+				progress_fd = -1;
+			}
+			else
+			{
+				close(fd);
+			}
+		}
+		break;
 	    case 'd':
 		file_add(optarg,fdt_drop);
 		break;
