require "luarocks.loader"

require "lfs"

BasePath = arg [ 1 ]

DataTable = { }

for TDir in lfs . dir ( BasePath ) do

_ = TDir == "." or TDir == ".." or ( function ( Table )

return function ( Path )

( Table [ lfs . attributes ( Path ) . mode ] or function ( ) end ) ( Path )

end

end ) {

directory = function ( Path )

local Count = 0

( function ( Path , Func )

for Object in lfs . dir ( Path ) do

_ = Object == "." or Object == ".." or Func ( Path .. "/" .. Object ) or ( function ( Table )

return function ( Path )

( Table [ lfs . attributes ( Path ) . mode ] or function ( ) end ) ( Path )

end

end ) {

directory = function ( DPath )

debug . getinfo ( 3 ) . func ( DPath , Func )

end

} ( Path .. "/" .. Object )

end

end ) (

Path ,

( function ( Table )

return function ( Path )

( Table [ lfs . attributes ( Path ) . mode ] or function ( ) end ) ( Path )

end

end ) {

file = function ( ) Count = Count + 1 end

}

)

table.insert ( DataTable , { Count , Path } )

end

} ( BasePath .. "/" .. TDir )

end

table.sort (

DataTable ,

function ( A , B )

return A [ 1 ] < B [ 1 ]

end

)

for _ , Data in pairs ( DataTable ) do

print ( unpack ( Data ) )