| 
									
										
										
										
											2010-12-11 23:47:03 -07:00
										 |  |  | (function () { | 
					
						
							| 
									
										
										
										
											2010-12-12 02:13:40 -07:00
										 |  |  |   var walk = require("../lib/walk.js"), | 
					
						
							| 
									
										
										
										
											2010-12-11 23:47:03 -07:00
										 |  |  |     emit = walk(process.argv[2] || "/tmp"); | 
					
						
							|  |  |  |     //icount = 0;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-12-12 01:58:43 -07:00
										 |  |  |   emit.on('directories', function (path, dirs, next) { | 
					
						
							|  |  |  |     dirs.forEach(function (dir) { | 
					
						
							|  |  |  |       console.log(path + '/' + dir.name); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |     next(); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   /* | 
					
						
							| 
									
										
										
										
											2010-12-11 23:47:03 -07:00
										 |  |  |   emit.on('directory', function (path, file, next) { | 
					
						
							|  |  |  |     //icount += 1;
 | 
					
						
							|  |  |  |     console.log(path + '/' + file.name); // + " " + icount);
 | 
					
						
							| 
									
										
										
										
											2010-12-12 01:58:43 -07:00
										 |  |  |     next(); | 
					
						
							|  |  |  |     //process.nextTick(next);
 | 
					
						
							| 
									
										
										
										
											2010-12-11 23:47:03 -07:00
										 |  |  |     //setTimeout(next, 100);
 | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   emit.on('file', function (path, file, next) { | 
					
						
							|  |  |  |     console.log("FILE:", file.name, "\n"); | 
					
						
							|  |  |  |     next(); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   emit.on('directory', function (path, dir, next) { | 
					
						
							|  |  |  |     console.log("DIR:", dir.name, "\n"); | 
					
						
							|  |  |  |     next(); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   */ | 
					
						
							|  |  |  | }()); | 
					
						
							|  |  |  | 
 |