• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            我希望你是我獨家記憶

            一段永遠封存的記憶,隨風而去
            posts - 263, comments - 31, trackbacks - 0, articles - 3
               :: 首頁 :: 新隨筆 ::  :: 聚合  :: 管理

            python獲取文件夾大小(2)

            Posted on 2009-07-28 14:07 Hero 閱讀(453) 評論(0)  編輯 收藏 引用 所屬分類: 資料整理
             1 #!/usr/bin/env python
             2 #
             3 #       getDirSize2.py
             4 #       
             5 #       Copyright 2009 Hiro <wangzhaoren@gmail.com>
             6 #       
             7 #       This program is free software; you can redistribute it and/or modify
             8 #       it under the terms of the GNU General Public License as published by
             9 #       the Free Software Foundation; either version 2 of the License, or
            10 #       (at your option) any later version.
            11 #       
            12 #       This program is distributed in the hope that it will be useful,
            13 #       but WITHOUT ANY WARRANTY; without even the implied warranty of
            14 #       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
            15 #       GNU General Public License for more details.
            16 #       
            17 #       You should have received a copy of the GNU General Public License
            18 #       along with this program; if not, write to the Free Software
            19 #       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
            20 #       MA 02110-1301, USA.
            21 
            22 
            23 import os
            24 #from os import listdir
            25 
            26 def getDirSize( source ) :
            27     size = 0L
            28     if os.path.isfile( source ) :
            29         size += os.stat( source )[6]
            30     elif os.path.isdir( source ) :
            31         for src in os.listdir( source ) :
            32             srcpath = os.path.join( source, src )
            33             print srcpath
            34             size += getDirSize( srcpath )
            35     
            36     return size
            37     
            38 def main():
            39     
            40     dirname = r"/home/wangzr"
            41     print getDirSize( dirname ) / 1024 /1024
            42     return 0
            43 
            44 if __name__ == '__main__': main()
            45 

            中文国产成人精品久久不卡| 天天躁日日躁狠狠久久| 亚洲狠狠久久综合一区77777| 国产精品久久一区二区三区| 久久精品成人免费网站| 久久影视综合亚洲| 久久久久久久久无码精品亚洲日韩 | 久久久久九九精品影院| 久久无码专区国产精品发布 | www.久久热.com| 97香蕉久久夜色精品国产| 91精品国产高清久久久久久io| 久久久久国产视频电影| 国产精品一区二区久久不卡| 亚洲人成无码www久久久| 久久久91精品国产一区二区三区 | 99久久无码一区人妻| 一本色道久久99一综合| 亚洲&#228;v永久无码精品天堂久久 | 欧美国产成人久久精品| 久久91这里精品国产2020| 99久久99久久精品免费看蜜桃| 热99RE久久精品这里都是精品免费 | 久久99精品久久久大学生| 久久精品国产亚洲AV不卡| 久久中文娱乐网| 久久这里只精品国产99热 | 久久青青草原精品国产软件| 99久久精品国产高清一区二区| 亚洲女久久久噜噜噜熟女| 久久亚洲精品无码aⅴ大香| 久久只有这精品99| 亚洲欧洲久久av| 久久婷婷五月综合成人D啪| 中文成人无码精品久久久不卡 | 亚洲欧美一区二区三区久久| 久久成人18免费网站| 久久精品国产WWW456C0M| 久久激情五月丁香伊人| 欧美久久久久久午夜精品| 久久婷婷色综合一区二区|