Maybe this will really make the progress display better.
This commit is contained in:
		
							
								
								
									
										8
									
								
								backly.c
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								backly.c
									
									
									
									
									
								
							@@ -259,7 +259,7 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
 | 
				
			|||||||
			
 | 
								
 | 
				
			||||||
			// Only copy file if it doesn't exist or has changed
 | 
								// Only copy file if it doesn't exist or has changed
 | 
				
			||||||
			if (needToCopy == 1) {
 | 
								if (needToCopy == 1) {
 | 
				
			||||||
				printf("+ %s 100.00%%", itemSrc + srcPrefix);
 | 
									printf("+ %s ", itemSrc + srcPrefix);
 | 
				
			||||||
				fflush(stdout);
 | 
									fflush(stdout);
 | 
				
			||||||
				if (testMode == 0) {
 | 
									if (testMode == 0) {
 | 
				
			||||||
					int pid = fork();
 | 
										int pid = fork();
 | 
				
			||||||
@@ -271,7 +271,7 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
 | 
				
			|||||||
					} else {
 | 
										} else {
 | 
				
			||||||
						struct stat srcStat, destStat;
 | 
											struct stat srcStat, destStat;
 | 
				
			||||||
						double pDone = 0;
 | 
											double pDone = 0;
 | 
				
			||||||
						int numPrinted = 7;
 | 
											int numPrinted = 0;
 | 
				
			||||||
						if (stat(itemSrc, &srcStat) != -1) {
 | 
											if (stat(itemSrc, &srcStat) != -1) {
 | 
				
			||||||
							while (waitpid(pid, NULL, WNOHANG) == 0) {
 | 
												while (waitpid(pid, NULL, WNOHANG) == 0) {
 | 
				
			||||||
								if (stat(itemDest, &destStat) == -1)
 | 
													if (stat(itemDest, &destStat) == -1)
 | 
				
			||||||
@@ -285,6 +285,10 @@ void copyNew(char *src, int srcPrefix, char *dest, int destPrefix, int testMode)
 | 
				
			|||||||
								fflush(stdout);
 | 
													fflush(stdout);
 | 
				
			||||||
							}
 | 
												}
 | 
				
			||||||
						}
 | 
											}
 | 
				
			||||||
 | 
											for (int i = 0; i < numPrinted; i++)
 | 
				
			||||||
 | 
												printf("\b \b");
 | 
				
			||||||
 | 
											printf("100.00%%");
 | 
				
			||||||
 | 
											fflush(stdout);
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				printf("\n");
 | 
									printf("\n");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user