40 lines
521 B
Ruby
40 lines
521 B
Ruby
|
#!/usr/bin/ruby -w
|
||
|
|
||
|
# affiche la liste des fichiers du repertoire en argument
|
||
|
|
||
|
|
||
|
if ARGV.length < 1
|
||
|
puts "usage : ./testSgf_4.rb < nomRep >"
|
||
|
exit
|
||
|
end
|
||
|
|
||
|
rep=ARGV[0]
|
||
|
|
||
|
#changement de repertoire
|
||
|
|
||
|
|
||
|
Dir.chdir(rep)
|
||
|
|
||
|
d=Dir.open(rep)
|
||
|
|
||
|
d.each { |u| puts u }
|
||
|
|
||
|
puts "_____________REPERTOIRE_______________"
|
||
|
|
||
|
# si on veut filter les fichiers du repertoire
|
||
|
|
||
|
|
||
|
Dir["*.rb"].each do |f|
|
||
|
puts f
|
||
|
end
|
||
|
|
||
|
|
||
|
puts "_____________ARBORESCENCE_____________"
|
||
|
|
||
|
# si on veut parcourir toute la sous-arborescence
|
||
|
|
||
|
|
||
|
Dir["**/*.rb"].each do |f|
|
||
|
puts f
|
||
|
end
|