###
coffee -cb /opt/node/bb/dev/node_modules/atbar/atbar.cof
coffee /opt/node/bb/dev/node_modules/atbar/tests/fs.cof
atbar.run 'trace', 'debug', 'listing', ->
###

_ = 	require 'underscore'
_.mixin require 'underscore.string'
_.mixin require 'underscore.inspector'

fs		= require 'fs'
atbar	= require 'atbar'

dir = '/opt/node/bb/dev/cp/'

atbar.run ->
	@_ ->  fs.readdir dir, @$()
	@_ (_throw, dirList) ->
		@_ -> 
			if not (file = dirList.shift()) then @$()(); return
			if _.startsWith file, 'page_scrape_'
				console.log file
			@$('loop')()
	
