Skip to content

Instantly share code, notes, and snippets.

@soumith
Created August 1, 2014 17:56
Show Gist options
  • Save soumith/f4dd3ee76c8251f6e91a to your computer and use it in GitHub Desktop.
Save soumith/f4dd3ee76c8251f6e91a to your computer and use it in GitHub Desktop.
require 'paths'
local current_dir = 'torch7'
checkFile = function( current_dir )
local list = paths.dir( current_dir )
table.sort(list, function (a,b) return a<b end)
for i = 3, #list do
list[i] = paths.concat(current_dir, list[i])
if paths.filep( list[i] )then
print( ' ==> found file '.. list[i] )
else
print( '==> check sub directory ' .. list[i])
end
end
end
checkFile(current_dir);
@russellfei
Copy link

For someone new to paths tips are here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment