Hatena::Grouprubyist

krystal: プログラミング超初心者(文系)

2009-01-08 (Thu)たのしいRuby練習問題

P - 306 練習問題(3)

21:43

  • Unixのduコマンドのように、再帰的に掘り下げて調べ表示するメソッドduを定義してみよう。
def du(path)
  size = FileTest.size(path)
  if FileTest.directory?(path)
    Dir.open(path){|dir|
      dir.each{|name|
        next if name == "."
        next if name == ".."
        size += du(File.join(path, name))
      }
    }
  end
  printf("%8d %s\n", size, path)
  return size  #size(数字)を返さないと、↑のduはprintfを返すことになるからnil。だから、size+nilは怒られる
end

KaedonKaedon 2016/05/07 15:52 Hi Gina!I have a question not related to this post…I went back to read some of your early pregancy posts and you were saying that you ate a lot of pineapple because it would help with implantation (and I guess it did ). However now I’m also reading that you sh#7udn&o821l;t eat pineapple because it might stimulate labor. Have you ever heard of this? I still have one waiting for me at home and now I’m not sure if it’s good to eat it or bad to eat it!

CaidenCaiden 2016/05/08 22:32 Ce taranca esti in pozele alea Florica! Hi, hi, hi!Auzi, dar dupa <a href="http://omrxjg.com">prtoizopia</a> "Sa facem loc pentru porc" de ce apare o poza cu nasu tau de cununie, fostul tau sef, Adrian? :)

ConyersConyers 2016/05/09 10:37 Thanks for your response and for reading the site. You are correct, we just see the numbers not every game. Decision making is something he needs to improve upon going forward. <a href="http://fdsaci.com">Boaeeendhd</a> mistakes need to stop. I’m posting another story today about this and giving you credit for bringing this to my attention. His defense was a bigger issue than his batting last year and we need to keep that part of his game in mind.

iderabafiderabaf 2018/02/24 12:12 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uzopufouzopufo 2018/02/24 12:21 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

igigesehoxuoyigigesehoxuoy 2018/02/24 12:28 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

hakeyafoqubhakeyafoqub 2018/02/24 12:36 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

amudiqoifiamudiqoifi 2018/02/24 12:45 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

efatowfecefatowfec 2018/02/24 12:48 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uitacmiozimekuitacmiozimek 2018/02/24 12:49 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

actuqimayitadactuqimayitad 2018/02/24 12:54 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ezopadaxozezopadaxoz 2018/02/24 13:01 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

erjenugaterjenugat 2018/02/24 13:03 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

aveqxaposapadaveqxaposapad 2018/02/24 13:06 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

isezijupisezijup 2018/02/24 13:09 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uhaniyehiduuhaniyehidu 2018/02/24 13:09 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ipisofekeisipisofekeis 2018/02/24 13:23 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

owococodoowococodo 2018/02/24 13:25 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

euhnebuzoficeuhnebuzofic 2018/02/25 10:59 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

befubedulaogwbefubedulaogw 2018/02/25 11:18 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

inewokiwitwinewokiwitw 2018/02/27 04:34 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

izamoiqaiokuqizamoiqaiokuq 2018/02/27 04:40 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

udeyobiveudeyobive 2018/02/27 04:45 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

acariyiroacariyiro 2018/02/27 04:48 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

onifiruxowijaonifiruxowija 2018/02/27 04:50 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

enexasahaenexasaha 2018/02/27 04:56 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ovvomibuniaovvomibunia 2018/02/27 05:00 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ifakvavyixiifakvavyixi 2018/02/27 05:09 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ovageyaetuovageyaetu 2018/02/27 05:11 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

usayimufohebeusayimufohebe 2018/02/27 05:21 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

iaviheukousabiaviheukousab 2018/02/27 05:21 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

irawaecuheirawaecuhe 2018/02/27 05:24 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

inudijadirpejinudijadirpej 2018/02/27 05:25 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ayiufufodupayiufufodup 2018/02/27 05:36 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

uvepibebuvepibeb 2018/02/27 05:37 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

ugosbijopiugosbijopi 2018/02/28 04:32 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

izonuhukgazoizonuhukgazo 2018/02/28 04:48 http://levitra-20mg-priceof.online/ - levitra-20mg-priceof.online.ankor <a href="http://pricespharmacy-canadian.online/">pricespharmacy-canadian.online.ankor</a> http://buy-amoxicillin-amoxil.online/

aulumidiaxaulumidiax 2018/04/20 01:56 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

oreetosemcahoreetosemcah 2018/04/20 02:15 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ditunebagutarditunebagutar 2018/04/20 02:17 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

iepowiviruweiepowiviruwe 2018/04/20 02:30 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

gihdagigihdagi 2018/04/20 02:31 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

etbixinogeetbixinoge 2018/04/20 02:51 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ozuracotasigozuracotasig 2018/04/20 02:52 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ijehupuhedijehupuhed 2018/04/20 03:06 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

asiisekiasiiseki 2018/04/20 03:07 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

getapabiyogetapabiyo 2018/04/20 03:25 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

irhetakihiuiirhetakihiui 2018/04/20 03:27 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

awuguvarawuguvar 2018/04/20 03:34 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ooxivalieziooxivaliezi 2018/04/20 03:39 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

isowuwezoisowuwezo 2018/04/20 03:41 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

emoryajeemoryaje 2018/04/20 03:49 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

agihoqanamiqeagihoqanamiqe 2018/04/20 04:00 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ooojitoliooojitoli 2018/04/20 04:01 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

unjaaluituqunjaaluituq 2018/04/20 04:14 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

uhuyajieluhuyajiel 2018/04/20 04:16 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

obilqiwuobilqiwu 2018/04/20 04:32 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

nobacitizeznobacitizez 2018/04/20 04:35 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

icubicaicubica 2018/04/20 04:47 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

oginikuyuoginikuyu 2018/04/20 04:49 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

uciyagnuuciyagnu 2018/04/20 04:54 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

earitifearitif 2018/04/20 04:54 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

emimoqokiyemimoqokiy 2018/04/20 05:08 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

auifekiqoqiauifekiqoqi 2018/04/20 05:08 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ipeepecvaxipeepecvax 2018/04/20 23:35 http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ゲスト



トラックバック - http://rubyist.g.hatena.ne.jp/krystal/20090108